08-26-2010 12:00 PM
Hi,
i am able to make the plc communicate with labview 2009 using NI OPC Server and DSC Module via ethernet but i do not now to control and monitor plc boolean data from labview.
the plc i am using is Omron CJ1M CPU11 with CJ1W-ETN21. I am still very new to labview and i hope somebody can help me out with this and give me some advices on how to proceed. it should also be noted that i cannot change the status of the tags directly from NI OPC Server itself.
Below is the simple circuit i would like to use as a starting point for controlling and monitoring plc data from labview:
Thanks in advance for the help.
Solved! Go to Solution.
08-27-2010 02:45 AM
1. You need to set up OPC server to CJ1M communication following the step in Start>>All Programs>>National Instruments>>NI OPC Servers>>NI OPC Servers Help>>Omron FINS Ethernet>>Launch Driver Help.
2. Configure I/O Server binding to NI OPC Server.
3. Creating shared variable binding to NI OPC Server tags, and use these variables inside LabVIEW program to communicate with CJ1M.
#2 and #3, please follow http://zone.ni.com/devzone/cda/tut/p/id/7450
08-27-2010 04:51 AM
Yes, i have configured the communication between plc, opc and labview with the dsc module like the tutorial. i can also monitor the change in values of the opc tags when i change the states of the switched in cx programmer.
however, i do not know how to write data to the plc from labview. by writing data, i just mean to change the status of the control switches of the ladder diagram (force on, off) hence manipulating the output of the ladder diagram.
08-27-2010 05:27 AM
1. Drag shared variable you create in LabVIEW project to block diagram.
2. Right click on it>>Change it to write.
3. Wire the value you wish to write to a shared variable.
08-27-2010 05:52 AM
i tried doing a simple write before but it still does not work. is there a tutorial/ sample vi that i can learn from?
08-27-2010 09:53 AM
Please attach the whole project include opf file (OPC server configuration)
08-27-2010 04:18 PM
ok i have included the project files and the opc file as well.
08-29-2010 09:37 PM
You can read only from the input, cannot write.
For output, you can either write or read.
However, if you've a ladder controlling that output line.
It'll have a conflict.
09-06-2010 06:41 PM
thanks KateB. i finally can see it for myself. can write/read to output tags but can only read to input tags using datasockets. i just wondered why is it like that? could you explain it to me?
01-31-2011 03:51 PM
I had a similar problem with a Koyo DL06-DR PLC.
The solution was to build a ladder input multiplexer: the mux control bit is an internal flag. This flag gets cleared during the PLCs first scan and can be set/reset by the PC to steer where the PLC inputs would come from (either direct inputs or from PC control bits).
The outputs can be read/written anytime by the PLC or PC, so the PLC code is written using stage programming techniques, with set/reset instructions being placed only where needed.