06-05-2010 12:37 PM
Hallo I have a Contollogix PLC connect to cRIO 9073 by Ethernet , I configured the PLC to send e recive real data format.
I received data in the right way but when i send data to crio I read the data in the wrong way.
I'm using the labview ethernet library , the only data format supported by it is U8 8 bit integer.
Any one has experience whit this kind of application?
Tks a lot
Solved! Go to Solution.
06-05-2010 10:42 PM
06-06-2010 02:31 AM
I tried to use typecast VI but unsuccessfully.
I obtain a number that no match the value write from PLC.
If the PLC write 2 I have 8,96831E-44 using type cast
Attached PDF document just to better understand what happen between LW and the PLC.
Tks so much
06-06-2010 08:11 AM
I could be due to different endian format.
Toy around with this function, you can use the string to byte array function to get the data in a U8 byte array
Flatten To String Function
Owning Palette: Data Manipulation Functions
Installed With: Base Package
Converts the anything input to a flattened data string of binary values. You also can use this function to convert the byte order, or endian format, of the data in the flattened data string.
06-06-2010 09:24 AM
06-06-2010 09:01 PM - edited 06-06-2010 09:02 PM
Coq Rouge's answer is correct. It is endianism. You need to reverse the array when using typecast.
06-07-2010 06:32 AM
bsmauto wrote:
My data are already in U8 format , in the document the problem focus is describe!!
Then programming it is important to have attention for details ;). Computers and software may store number in different endian format. Google endianess for more info. LabVIEW uses Big Endian format for its binary numbers (same as Unix and MAC), while most Windows programs use Little Endian format.
I have included a demo for you. Try to send little endian input to big endian input and see what happened
06-07-2010 04:11 PM
Tks a lot to all for suggestion and clarify.
We got it!!!
06-07-2010 04:22 PM
06-07-2010 04:22 PM - edited 06-07-2010 04:25 PM
That's great. Can you then please mark the response which was the actual solution rather than your comment? You can unmark a solution using the Options menu that appears in the message's title bar all the way to the right.
EDIT: What Ravens Fan said.