ni.com is currently experiencing unexpected issues.
Some services may be unavailable at this time.
04-15-2019 01:28 PM
Hello-
I have been searching for a few days now and can't seem to get a handle on the number of ways to do this.
I want to simply send data from my PC to two tags on an AB PLC at a slow rate (once per second). Can someone give me some guidance? I thought I was going to just be able to broadcast some info in UDP but boy was i wrong. Any help or guidance would be appreciated.
1 -Looks like NI OPC server is an option but still unclear if I have to use LabView or if I can use the OPC client example in CVI and wing it from there? If all i want the PC to do is send tags to the PLC then isn't the PC the server and the PLC the client?
2 - Looks like Rslinx is another option but not sure if that replaces or still requires NI OPC or if I just use RSlinx. Also not sure if RsLinx might have a dll that is available. Is that true and is that an option?
3 - Looks like I cannot use Ethernet/IP?
I know C and i know CVI. I do not know LabView.
Anything info you can give me will help.
Kind regards,
Blue
04-16-2019 02:20 PM
Hi Blue,
Thanks for reaching out! The type of communication you can use will depend on what the PLC is equipped to handle. Some PLCs prefer MODBUS communication, others like Ethernet/IP- look through the documentation for your PLC to determine how it's expecting to receive the tags, and that should give you a good place to start.
The nice thing about working with our drivers is that the high level process should be the same, no matter what language you're working in. If you find information that appears to be LabVIEW-specific, but it describes a certain sequence of functions, you can usually call those same functions in C (or ones named very similarly) to receive a similar result.
NI OPC Server is a separate piece of software from our programming environments (LabVIEW, CVI, etc). This program will run on your Windows PC, and act as an intermediary between your programming environment and any PLCs or remote devices that are designed to work with OPC servers.
This forum thread goes into detail about working with OPC Servers from C, so I'd recommend starting there, if you'd like to work with an OPC server for your project.