From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

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

I have been trying to communicate with my Keller pressure sensor with Keller's Communication Protocol and I have written my own VIs to set the hexadecimal frame (see attached VI). I also wrote my own "16-Checksum" VI which shows the same CRC check as mentioned in protocol example at page 9.

 

I am then confident with my program, though it is still not perfect. The problem is that the answer that I get is something totally wrong against the one I should read (see Capture). My sensor's address is 91 -> 5B in hex display and I am just trying to read its pressure -> Function code 03.

 

If someone has already experienced this language and such a Keller device, I would be very very grateful for some hints.

 

Thank you in advance for your answer(s).

 

Best regards

Download All
0 Kudos
Message 1 of 16
(4,935 Views)

Hi,

 

Just had a quick look. The Language as you call is just plain ModBus protocol.

Disable the 'termination character' at the serial port setting. Now you are sending the data with a termination character and the read will stop if this character is in the received data.

If that doesn't help I will look further.

 

Kees

0 Kudos
Message 2 of 16
(4,898 Views)

Hi Kees,

 

Thanks for your answer. I have tried disabling it but this doesn't change anything.

 

Yesterday I noticed that the answer I got came from "noise" coming from other devices connected to the two RS485 wires. So I just got everything unplugged and now there's only my Keller sensor on the line.

 

Just for you to know, somebody had this device already configured before me but the guy is not in our lab anymore so I need to start from the beginning. I am going look in every other topics to find the answer and I will come back if I have something new.

 

Bests,

Mathias

0 Kudos
Message 3 of 16
(4,896 Views)
Solution
Accepted by topic author matbeg

Got the answer but I had to try everything possible...

 

My CRC-16 was not good. I was showing the numbers in decimal instead of writing two hexadecimal bytes for CRC16_L and CRC16_H.

Hope this will help somebody in the future.

 

Regards,

Mathias

0 Kudos
Message 4 of 16
(4,890 Views)

I am struggling with the same thing right now, would you be willing to share your .vi with me? I have a lot of experience writing .vi's for recording analog data (using DAQmx) but this is completely out of my wheelhouse. 

Thank you.

0 Kudos
Message 5 of 16
(4,419 Views)

Hi,

 

Can you show us what you got so far and tell what is wrong

Are you also using RS-485 and ModBus protocol ?

 

Kees

0 Kudos
Message 6 of 16
(4,407 Views)

All I have are a series of vi's provided by Kulite but I haven't the foggiest how to link them together. I'm fairly proficient with DAQmx but don't know a lick about RS-485 and ModBus protocol. If I can get to the point where I can read the pressure off the sensor at 1 Hz, I'll be quite happy. Any insight would be much appreciated. Thanks.

0 Kudos
Message 7 of 16
(4,390 Views)

Hi,

 

The VI's in the ZIP are not wired in a way I would do it. 

RS-485 and ModBus are two different things. First you have to sure that your interface is working. This can be easily checked with the  loopback command. Does the device supports the ModBus loopback command (0x08) I have a VI that only sends and receives the loopback command.

If you just want to read/write a few registers and/or bits you can use the ModBus library or wire some VI's yourself. Not that difficult.

 

Do you have a manual of your device ?

 

Kees

 

0 Kudos
Message 8 of 16
(4,384 Views)

Dear Geologian,

 

I finally managed to write my own vi to communicate with the device and for that, I asked for the Communication Protocol which I am attaching to this post.

I don't exactly know what kind of device you have and I don't know what you need to do, but if you want to write your own vi, you will always have the best results.

 

I am also sending you a picture of what it should look like if you want to only use VISA read, VISA write, and all the VISA stuff.

 

But from my side, I only got answers when I tried different things by reading a lot of different posts.

 

Good luck friend !

Download All
0 Kudos
Message 9 of 16
(4,379 Views)

Hi,

 

Here is a VI to test the interface with a loopback command. Could help you to get your RS-485 working.

 

Kees

0 Kudos
Message 10 of 16
(4,372 Views)