12-11-2017 01:56 PM
The transmitter works on ModBus. Thank you.
12-11-2017 01:57 PM
Can you also attached the sub VI's in your code and I'll give it a try? Thank you for your help.
Peter
12-12-2017 01:49 AM
Sorry for that. Here it is.
Kees
12-12-2017 09:48 AM
The loopback test was successful (i.e. there was a successful output in the read buffer indicator). How would you propose making the leap from using this loopback vi to getting the output voltage and/or pressure reading from this pressure sensor? I've attached the communications manual for this particular sensor. I understand I'm asking a lot, so as little or as much information you can provide is much appreciated.
Thanks.
12-13-2017 03:14 AM
Hi,
If you want to have a full blown ModBus communication and your device only uses standard ModBus commands you could use the ModBus lib from NI.
I don't use it because I have device with dedicated commands and I want to have more control over the communication (for error finding, debugging devices, etc.)
If you want to do it with your own VI's we can start with a simple read of the first register. In the manual 4.5 at page 9 describes the register read. In 4.9 I take the pressure of sensor 1. (slave 1)
The command for this: 010300020002 + CRC slave 1 - command 03 - register 0002 - read 2 registers.
The result is something like this: 0103 0400 0116 80A4 33 slave 1 - command 03 - 4 bytes - 00011680 is the data you want + CRC
The 32 bits data is a FP number.
The attached VI is just the Loopback with some changes.
The next commands (write register, read/write multiple registers) are basically the same. But first this one.
Kees
12-14-2017 03:31 PM
Thanks so much. With your help and a couple of hours I've been able to piece together something serviceable. I appreciate your help.