LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Modbus real to unsigned integer conversion

Is there any alternative way of decoding the two unsigned integer 16 bit words received through Modbus when using reals? I am using the join numbers and type cast functions; however I am not able to download the complete Modbus list to a compact RIO with 32 MB RAM as it runs out of memory.

0 Kudos
Message 1 of 4
(3,718 Views)
That's how I do it too:  join the two U16s and cast to SGL.  What do you mean by "I am not able to download the complete Modbus list to a compact RIO"?  Maybe some background on the task at hand...
 
-Khalid
0 Kudos
Message 2 of 4
(3,709 Views)

Khalid,

Thanks for your response. However, let me tell you more about my problem:

Basically my project consists of:

1. A list of shared variables within a library that also contains modbus slave with the communication settings.

2. (5) VIs that used to convert UInt16 to Single (for inputs) and Single to UInt16 (for otputs)

3. (1) VI to display information

As I try to download into a cRIO-9002 with 32MB of RAM, the device drops the communication and goes into safe mode, blinking the STATUS light 4 times, this means "run out of memory" .

I would like to know if there is any other alternative way to overcome this problem. Join and cast is functionally correct but it uses too much RAM

0 Kudos
Message 3 of 4
(3,700 Views)

Are you trying to use your cRIO host as a Modbus Slave so other devices can talk to it?  If that's the case, I am sure that's costing you more memory than anything else.  Especially if you are using the Modbus library by NI.  Its Modbus Slave allocates some large arrays (65536 elements each) to implement the various registers.  See the MB Registers Manager.vi. 

Please clarify if I misunderstood your last post.

Regards,

-Khalid

 

0 Kudos
Message 4 of 4
(3,695 Views)