LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

TCP/ IP comunication with ADAM 4571

Hello,
I'm LabView beginner and my question is maybe trivial...
I would like to create a VI, which will acquire data from modules (ADAM 4000 serie) connected to RS-485. I've got ADAM 4571 (RS-485/TCP IP converter) to get data to PC through twisted cable. I examined examples containing tcp/ip comunication and built similar VI, but it doesn't work. The VI looks this way: First function: Tcp Open Conection with ip adress of ADAM 4571 and port number 5202 (info from manual), second function: Tcp write with command: e.g.: $02F\r (-read firmware version of modul no adress 02). Next function is TCP Read to capture an answer of modul 02 and finally TCP Close Conection. When I run the VI with debuging bulb (highlight execution) on, it stops in TCP read function, returns no value and I have to abort execution. I don't know, whether I should use listen function to wait for answer or another functions to solve this problem?  Thanks for any advice.
0 Kudos
Message 1 of 4
(5,448 Views)
Hi Zimin,
 
What happens when you run it without highlight execution? Do you get an error? Can you post a screenshot of your code? Are you able to communicate with the device in Measurement and Automation Explorer? You might want to look at these instructions.
Regards,

Hillary E
National Instruments
0 Kudos
Message 2 of 4
(5,423 Views)
Hello Hillary_C,
 
in MAX is the situation same as in Labview. When I run VI without highlight execution the VI returns no value. There are some screenshots attached to this message showing the situations.
 
0 Kudos
Message 3 of 4
(5,392 Views)
In your message you say that the command is $02F\r, but in your LabVIEW code you have $02F/r. If the command needs to be terminated by a carriage return then you need to do this properly. If you have a string constant on the block diagram and enter $02F\r you will NOT get a carriage return sent out at the end. You will get the character "$" sent out, followed by the character "0", then "2", then "F", then "\", and then "r". That's not the same as the single character which is the carriage return. In order to specify a carriage return you need to set the string to "\" display mode and enter the character in \ mode.

To do this:
  1. Place a string constant on the block diagram.
  2. Right-click on the constant and select "\" Codes Display from the popup menu.
  3. Enter the text $02F\r in the string constant.
0 Kudos
Message 4 of 4
(5,380 Views)