Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UInt32 #3

Open
MaxsoftLtd opened this issue Jun 28, 2022 · 4 comments
Open

UInt32 #3

MaxsoftLtd opened this issue Jun 28, 2022 · 4 comments

Comments

@MaxsoftLtd
Copy link

Hi there!
your dll is exactly what I need - except I need it to read and write Uint32 instead of Uint16.
Can it be done?

@mcNets
Copy link
Owner

mcNets commented Jun 30, 2022

What FINS commands do you need?

@mcNets
Copy link
Owner

mcNets commented Jun 30, 2022

You can read no matter how many bytes from memory and convert later to Uint32.

@MaxsoftLtd
Copy link
Author

I need read DM, read DMs and write.
If I try to read as Uint32 the data is not right because I didnt write it as Uint32.
If you could edit the dll to work with Uint32 it would be great to me. I couldnt make it work

@mcNets
Copy link
Owner

mcNets commented Jul 5, 2022

Well, the easiest way is by using MemoryAreaRead function. You can read 4 bytes (or a multiple of 4) and then convert them to Uin32.

I have no tested it, but it could be something like this:

public bool ReadDM32(UInt16 position, ref UInt32 value)
{
	if (!finsMemoryAreadRead(MemoryArea.DM, position, 0, 2)) return false;
	value = BitConverter.ToUint32(this._finsCmd.Response, 0);
	return true;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants