LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how can I communicate with multiple RS-485 devices on one serial port?

I have 4 Advantech ADAM 4050 modules with different ID adresses and I can communicate with them very good. How can I program a toggle switch to send and receive the data's of different ID's in one LabView Application?
0 Kudos
Message 1 of 8
(8,625 Views)
Johannes,
It kind of depends on how you're communicating with the ADAM units.
We've been using their big brothers the ADAM 5000 series. We started using
Advantech's drivers, but they were slow, opaque and hard to use. We then
started using the VISA drivers for serial I/O and talking to them using the
protocol in the ADAM book.

To do this use the VISA Configure Serial PortVI to set up Baud rates,
etc. Then us the Open VISA command to open you com port. You can then use
the write VISA command to send commands to each ADAMs unit in turn (orwhen
it's enabled by your switch). The string in the command will be different
for the different ID addresses. Then use the read VISA command to read the
reply. If you always have the same number of characters in a r
eply, you
can use that to determine the length of the reply, but I prefer to select a
carriage return character using the VISA Configure Serial Port VI for the
ADAM5000 series (probably same for 4000 series).

--
Regards,
Alf Katz,
alfkatz@removethis.ieee.org

"Johannes Kuder" wrote in message
news:506500000008000000BD1F0000-986697009000@quiq.com...
> I have 4 Advantech ADAM 4050 modules with different ID adresses and I
> can communicate with them very good. How can I program a toggle switch
> to send and receive the data's of different ID's in one LabView
> Application?
0 Kudos
Message 2 of 8
(8,625 Views)
hi ,
i have the same kind of problem : i am using NI-VISA
and want to make a serial connection to RS-485 but
i dont know where do i code the address of the devices.
i can open the connection to com1 and i dont know where
in the write function i code the address.
can you please send me some example code .
best regards
Noam Cohen
Noam@hor-tal.netis.co.il
0 Kudos
Message 3 of 8
(8,624 Views)
Dear Mr. Katz,
you mentioned in the NI forum a solution to set up a communication of labview with the Advantech ADAM 5000 modules. Actually, we purchased ADAM5000/485 with 5055S and 5018 modules and trying to set them up. Could you send us a suggested solution to operate the ADAM system by Labview? Do you have any code, either implemented with VISA drivers or the NI Modbus library?
Thanks for your help in advance
 
kind regards
Christoph Mayr
0 Kudos
Message 4 of 8
(8,213 Views)
Howdy cmayr,

For what it's worth, I just wanted to let you know that I found a this page on Advantech's web site that says you can use an OPC server to connect to their 5000/485 series of hardware from LabVIEW. Another option might be to contact Advantech to see if they have any readily available LabVIEW drivers for your hardware. Unfortunately we do not have any on NI.com, but I wouldn't be surprised if Advantech has some available on their web site.

Cheers!
Warm regards,

pBerg
0 Kudos
Message 5 of 8
(8,182 Views)
pBerg, thanks for your remarks.
 
In the meantime I tried to use the MODBUS libray from NI. As I mentioned before, I use the ADAM 5000/485 system of Advantech with 4 modules: 3x ADAM 5055s (8DI and 8DO) and 1x ADAM 5018 (7ch Thermocouple inputs). The digital in- and outputs are trivial with the "MB Serial Example Master.vi" , using the functions "read coils" and  "write multiple coils". Each channel is controllable with boolean control elements and the reading of DI is also working. The start address and channel length of each module is 0X00001, 16 ; 0X00017, 16 ; 0X00033, 16 respectively. In this case it is easy to specify the starting address in the container, as long it is an unsigned integer with 8bits.
My question is now, how to read out the analog values of the thermocouple inputs with start address and channel length 4X00025, 8  ?? Is there any way to address the right registers? I do not see any other possibility to read out analog values... ("Read holding register", "Read input registers"). Does anybody have an idea ho the read out these analog values?
 
thanks for your efforts.
cmayr  
0 Kudos
Message 6 of 8
(8,113 Views)
Hi cmayr,

Seeing as you have the start address and channel length, you should be able to read the input registers from it. Was this successful?

I have modified the example VI to do a simple read input registers. Let us know how it goes!
Rasheel
0 Kudos
Message 7 of 8
(8,075 Views)

Ok, look men

the only thing you have to do,

is first,

get a rs-485 multiport card, ni sells it, or moxa, or a dropped connection trough your devices one of the advantages of rs-485 is that you may usea the same port with many devices thats called multi drop connection,

and then, if your device has a modbus output, you jut have to asign a modbus slave address and thats all... when you create your drive you usea the modbus address youve asign to get to ur device. as that of easy... you can data from all the devices in you network at the same time just make sure you use goods values in the poll rate, the right baud rate.... so

good luck

0 Kudos
Message 8 of 8
(7,971 Views)