Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Frame to write for RS485 communication with Keller pressure sensor

Solved!
Go to solution

The transmitter works on ModBus. Thank you.

0 Kudos
Message 11 of 16
(1,565 Views)

Can you also attached the sub VI's in your code and I'll give it a try? Thank you for your help.

Peter

 

0 Kudos
Message 12 of 16
(1,565 Views)

Sorry for that. Here it is.

 

Kees

0 Kudos
Message 13 of 16
(1,536 Views)

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.

0 Kudos
Message 14 of 16
(1,529 Views)

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

 

 

 

 

 

0 Kudos
Message 15 of 16
(1,522 Views)

Thanks so much. With your help and a couple of hours I've been able to piece together something serviceable. I appreciate your help.

0 Kudos
Message 16 of 16
(1,509 Views)