LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

rs485

i'm new to labivew application, and i was trying to create a this program that will allow me to send messages to another system through RS485.
i got this document, it said that i have to put "msb & lsb" how do i do that in labview? so, i'm not sure if i should it send in acsii or binary or hex.


Message Edited by aznw82 on 12-03-2007 10:32 AM
0 Kudos
Message 1 of 34
(9,026 Views)
here is my program in labview
0 Kudos
Message 2 of 34
(9,017 Views)
You can use join numbers in the data manipulationn palette to join two U8 number to one U16.

However I would suggest that you use arrays of U8 to build your message and then convert the array of U8 to string (hex) and send it. You will need the bytes in U8 form to be able to calculate the CRC.
Regards,
André (CLA, CLED)
0 Kudos
Message 3 of 34
(9,005 Views)
i did change those numbers to U8 format, and calculate the checksum. but, it didnt seems to work.
so, i don't know whats wrong with my program.

0 Kudos
Message 4 of 34
(8,997 Views)
This is BAD programming....
The "data string" can be transmitted before calculated.. Labview works in parallel.
Although the data will be there for the next iteration...
where is the "two's complement on the result" ? (checksum)
 
the event structure has no meaning... exept for stoping the vi.
0 Kudos
Message 5 of 34
(8,984 Views)

i know, i'm new to this program. the checksum calculation is at the bottom of the HDR, they're all in binary format.

do you know a easiler way to do this?i  really need the help. thanks. 

0 Kudos
Message 6 of 34
(8,967 Views)

Does your hardware has an example, so you can use it with hyper terminal?

Then you will know that everything (hardware) is ok, and you can go on with Labview..

0 Kudos
Message 7 of 34
(8,965 Views)
there is just one cable connection for the rs485. the system doesn't have hyper terminal for me to use.
all i can count on is my software.   
0 Kudos
Message 8 of 34
(8,961 Views)
First start by creating an exmple string that the device accepts as valid data. Use this string as a constant in put to the VISA write and see what happens. First get it to work with a manually created string. Then if that works try to create code that build the manually constructed message automatically. If that works too, you should have code that can create any message of that type.

Search the web for a modbus CRC calculation example instead of using the constant number in bin format, there multiple available. (e.g. http://forums.ni.com/attachments/ni/170/124058/1/calc-ModBus-crc.zip).
Regards,
André (CLA, CLED)
0 Kudos
Message 9 of 34
(8,957 Views)
tried to send a constant number, and still doesn't work. is there something wrong with my program?
0 Kudos
Message 10 of 34
(8,921 Views)