LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Modbus

    I wish to thank the community for the help in getting the Modbus tool to work for reading from my Watlow controller but, I am need of assistance in getting it to write.  I do not get any errors when I run it but I also do not get a set point change either.  I am trying to write to a single register (word address 2160) for a set point change but it does nothing when I run it.  I write a single precision value to the register but again it does not seem to work and have ran out of ideas.  Thank you for your patients.

0 Kudos
Message 1 of 7
(1,200 Views)

Modbus registers are typically 16-bit unsigned integers.  You're trying to put a 32 bit signed single-precision float in there.  Do you see the red coercion dot on the Write call?

 

In my experience, in most cases, to write a value that "looks like" a floating point, a Modbus device will either:

  • Use a certain amount of inferred decimal places
    • For instance, it could take inputs in "hundredths", so to set the value 12.34 you would send the integer 1234
  • Or, it could be divided into two registers that you need to write to at the same time.
    • This would be done by taking the 32 bits of the SGL, type casting it to a U32, splitting it to a U16, and then writing both U16s simultaneously.

Since we can't see what values you're trying to write, the address to write it to, nor do I know what the documentation of the Watlow you're using says about the register in question, I can't give more hints than that.

0 Kudos
Message 2 of 7
(1,190 Views)

    The Watlow is looking for 32 bit floating point which is in both the read and write registers.  I tried to type cast to a U32 and then split it like suggested but it did not change the set point as before but that was a good thought.  I am hesitant to use U(n) inputs since we need the I(n) ability to go to negative temps.  The write address for changing the set point is 2160.  For background I have been successfully using these for over a decade but with GMobdus which I cannot get a license for anymore.  

0 Kudos
Message 3 of 7
(1,169 Views)

I'm not sure if this applies to you but this document has a procedure on how to write set temp procedure. 

As it was written before, a 32 float has to be break down in 2 16 bit in adjacent addresses. 

 

 

0 Kudos
Message 4 of 7
(1,160 Views)

This is from a Watlow manual which may or may not be the device you are using:

Kyle97330_0-1698859156771.png

As such it could be that to set it you might need to set both 2160 and 2161, and without checking your device setup it's not possible to know which one should be which.

 

Since you do probably need to set two, you should probably be using a "write multiple registers" VI, not just a single register write.  Try it in both ways.

 

Note that I said "Type cast", not "convert to".  The difference is important.  A SGL uses bits like this:

Kyle97330_1-1698859417185.png

If you type cast properly, then you get those bits as a U32 which will often be a number in the millions or billions if you read it as an integer.  If you just convert it you will get a number like "25".  I mention this because you brought up the need to go negative as a reason not to use U32, implying that you might have just done a "convert".

Message 5 of 7
(1,153 Views)

Thanks I will do a deeper dive and see if I can find the issue with writing. I am sure it is a formting issue.

0 Kudos
Message 6 of 7
(1,146 Views)

Thank you for your help and I now have a working solution.

0 Kudos
Message 7 of 7
(1,069 Views)