LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

data plc labview

Solved!
Go to solution

First off thank you for anyone that reads this, I am very new at LabVIEW, and I think this maybe a trival question but I am not sure. 

 

I am building a test bench to measure the torque vs angle of clutch disc to find the hystersis. I am confedient that my program is fine to record the data. I am usin a servo motor to apply the torque and when the torque gets to high I want the plc to shut off the servo motor. I want LabVIEW for the data acqusition but the plc for the control. I have no experience with modbus. I was wondering if i could share the output from the torque transducer with both the plc and LabVIEW or would this weaken my signal and affect my data? The torque transducer is a mv/v output, the tourque transducer is TRS-20K from transducer techniques. I will be using a PLC from automation direct, and a NI-9237. 

 

http://www.transducertechniques.com/trs-torque-sensor.aspx

 

Thansk for your time

Message 1 of 12
(5,970 Views)

Hello Carl,

 

There are a couple of different protocols we can use to communicate between LabVIEW and PLCs. These protocols are usually included in specific LabVIEW software packages.  Are you using LabVIEW 2014 Real-time or the DSC module? These include support for Modbus along with other OPC Server communication protocols. 

 

If you do not currently own these packages, I would recommend using DataSocket. 

http://www.ni.com/white-paper/3224/en/

The Monitor OPC Items with DataSocket.vi in the Example Finder might be a good place to start.

 

Regards,

Thomas C.
FlexRIO Product Support Engineer
National Instruments
0 Kudos
Message 2 of 12
(5,884 Views)

Thanks for the reponse. We do not have realtime as far as I know it a the basicLabVIEW package. My company and I are both new to LabVIEW and would like to stay away from the modbus stuff as it is an extra cost. I was thinking since I only need to stop the PLC when the torque gets to high I could run an analog output from a DAQ card like a NI-6001 from a true false statement in my LabVIEW programming to the PLC input. I know this would not be done in "real-time" but we are taking data rather slowly and figured this would work. I have been told that even modbus could be somewhat delayed in its response. Does this seem like a viable soloution?

 

Thanks for your time

0 Kudos
Message 3 of 12
(5,859 Views)

Hello Carl,

 

It sounds like all you need to do is send an on/off signal to a PLC.  Any communication (modbus, OPC, DataSocket, EPICS) that occurs between the host PC and a PLC is non-deterministic.  These will all result in some form of varying delay. 

 

The USB-DAQ will be able to output a signal from your computer to your PLC.  If you program the PLC to record the signal from the DAQ to control your transducer, this should work.  There will be a delay between when you send the output signal to the DAQ and the PLC reacts.  This delay will not be deterministic.  It will vary depending on your current operating system usage.  With that being said you should be able to get a response within 100ms.

 

How fast are you looking to control this PLC?  Do you need the control to have a deterministic/consistent delay? Are you doing closed loop control testing?

 

Hypothetically, if your computer crashed while the DAQ is in applying torque, you would still be applying torque until you reset the device.  If you continually torque, will this damage any of your setup?  If so, I would recommend implementing some kind of watch dog timer on the PLC which can be reset by the DAQ.

 

If you are looking for a deterministic solution, I would recommend using a cRIO with LabVIEW Real-time.

 

Regards,

Thomas C.
FlexRIO Product Support Engineer
National Instruments
0 Kudos
Message 4 of 12
(5,829 Views)

What PLC are you using?  I use the Domore PLC and can steam UDP Data out of the PLC. This can be at 10ms. Use Labview to chart the data and to send a setpoint back to the PLC for the breakaway torque to stop the motor. Use a second NiC card in your PC and have have the PLC use a cross over cable or a stand alone network switch. Put your UDP send in a timed interrupt task. Program with the serial port so not to use network resource. By sending a setpoint back to the PLC If communication is lost to the PLC can still stop the Servo motor. DO you have speed of the Load and Servo Speed? If so you could determine when the clutch starts to slip because or the speed difference. 

0 Kudos
Message 5 of 12
(5,813 Views)

Thomas, 

 

I do not know how fast I need to control the PLC, because this is a piece of testing equipment and depending on the parts that we are benchmark can throw a lot of variables into the mix. For the most part I beleive 100ms would be acceptable. But with that being said safety is a huge factor this design with torque up 1500 ft lbs.

 

What I want is the safest most consistant communicatation between LabBVIEW and PLC I can currently get. We have the professional build of LAbVIEW and I don't know if that includes these communication protocalls. I know we dont have OPC server for it is an extra cost.

 

This is an open-loop testing device it cycles one time with no feedback. 

 

What I am worried about is if "hyoothetically" the computer crashed and the PLC didn't stop, someone could get hurt. 

 

I have a brief LabVIEW course in college so I understand the basics of programing but when things get into strings, servers, etc I get lost. Any help for the programming of modbus to say on or off for the PLC would be great. 

0 Kudos
Message 6 of 12
(5,764 Views)

Dave, 

 

We are using Automation Direct PLC I believe it is the 205 CPU. For the setup you suggest what Ni Cards are you talking about (so I can look them up). I do not have a speed of the load as of yet, we still in the manufactoring phase. I wanted to hook everything up with no load to see what kind of speed we want. 

0 Kudos
Message 7 of 12
(5,757 Views)

If you have the H2-DM1E you can use Ethernet. Any NIC Card will work as long as long as the IP address is configured correctly for the plc and your pc.

 

You can also use the rs232 plc port and modbus rtu to communicate with labview. Ether is capable of the 100 ms cycle time.

 

I would recommend using you PLC as a modbus master and send the data to labview as a modbus slave. There is a free library and examples of how to do this with labview. You can download at http://ftp.ni.com/pub/devzone/epd/nimodbus121.zip 

 

The PLC as a Modbus master knows if the communication is successful and can stop your test if you have a com failure. If you use labview as the modbus master than you need to set up a value that constantly changes in the plc (counter each read/write ) to detect a com failure.

 

Professional Development has everything you need for the Labview Software except the nimodbus121.lib  I use this with the DoMore PLC software and Labview 2010,2012 and it works well.

0 Kudos
Message 8 of 12
(5,737 Views)

Hey Carl,

 

I think you are using addressing in PLC to store your data someware for calculation. You can fatch those PLC address via simple serial commands from LabVIEW. For that, you need to refer the manual for the PLC for commands to be used to fatch data from PLC address, as well designing of serial cable, if not defined in manual. The same I am using with Keyence-KV700 series PLC. It is fast (~20ms to command-response cycle for single address), gives instantanious value of address.

 

 I don't think this will cost you more.

 

Regards,

 

DCKAN


Best Regards,
DCKAN

"We make a Living by what we get. We make a Life by what we give."
0 Kudos
Message 9 of 12
(5,724 Views)
Solution
Accepted by topic author carlgober90

Hello All,

 

Thank you very much for helping out Carl.

 

Carl,

 

If you are looking for the cheapest and most reliable solution, I think that Dave has a great solution.  This library is however not directly supported by NI so I will be unable to help.

 

Regardless of the solution that you choose, I still recommend looking into watchdog timers. 

 

http://en.wikipedia.org/wiki/Watchdog_timer

 

This is a great method to abort your PLC if the host computer crashes.

 

Regards,

Thomas C.
FlexRIO Product Support Engineer
National Instruments
0 Kudos
Message 10 of 12
(5,668 Views)