LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

machine control

Hello All,

I have a 2 part question here. I'm trying to decide on which way to go in implimenting an upgraded LV test station. Currently, I've replaced the the bench top scopes with a LV program that aquires the data and tests it to meet specification. However, the test station still uses a control box that houses, among other things, a Koyo DL05 PLC. There is very limited input and output required for the test station:

Input:
Cylinder A up / down
Cylinder B in / out
Test Button


Output:
Cylinder in
Cylinder Down
Motor Start
Motor Direction

The test routine is as follows:
Press Start, cylinder A goes down, cyclinder B goes in, motor starts, data check, reverse motor, data check, motor stop, cylinder B out, cylinder A up.

Pretty simple, huh? The reason I want LV in the loop machine is so that the operator can just click once to get tests in both directions. Right now, the operator has to press the Start button a second time to get the other direction and has to also click the LV Test button to initiate LV testing of that direction. Pressing the hardware button a 3 rd time ends the test.


Question 1) more of an opinion I guess. I'll be using a PXI-6514 DIO card. Should I keep the PLC or just let LV handle it?

Question 2) I haven't written any code where LV is utilizing a DIO for machine control. What is the basic recommended technique. Event structures? Qued messge handling?

Any pointers would be appreciated.




~~~~~~~~~~~~~~~~~~~~
Paul Johnson
Renco Encoders, Inc
Goleta, CA
~~~~~~~~~~~~~~~~~~~~
0 Kudos
Message 1 of 12
(3,742 Views)
I guess I shouldn't post questions at 5 PM on Friday. Or maybe I shouldn't ask such lame ones?Smiley Wink
~~~~~~~~~~~~~~~~~~~~
Paul Johnson
Renco Encoders, Inc
Goleta, CA
~~~~~~~~~~~~~~~~~~~~
0 Kudos
Message 2 of 12
(3,716 Views)
I would get rid of the DL05 if you are only using it for digital I/O, and use Labview alone.  I would just use a simple state machine for this in Labview.
0 Kudos
Message 3 of 12
(3,714 Views)
Thanks for the response Brian,

So, what technique is employed to make the state machine wait for the proper DIO? Should it look like the attached VI?
~~~~~~~~~~~~~~~~~~~~
Paul Johnson
Renco Encoders, Inc
Goleta, CA
~~~~~~~~~~~~~~~~~~~~
0 Kudos
Message 4 of 12
(3,709 Views)

I would just put the digital input in a loop and wait until it becomes true.  This really isn't deterministic using Windows, but it is probably good enough for what you are doing.

0 Kudos
Message 5 of 12
(3,704 Views)
Hi Paul and Brian-
 
Brian's approach of polling should work well.  If you are ambitious (and you had a really great DAQ and Signal Conditioning teacherSmiley Wink) you could use DAQmx events for change notification with your 6514 device.  This method would require LabVIEW 8.0 and NI-DAQmx 8.0 and would allow you to more efficiently react to changes on digital inputs without having to poll.
 
I have attached an example that shows how to configure input lines to fire change detection events via the LabVIEW Event Structure.  If you want to go this route this should hopefully be a good starting point.  If you are looking for a quicker method to update your SW and get started with something you're more comfortable with you can just poll and use a standard state machine approach like you suggested before.
 
Hopefully this helps- let me know if you have any additional questions.  Thanks a lot-
Tom W
National Instruments
0 Kudos
Message 6 of 12
(3,691 Views)
Thanks Tom,

I've got LV 8.0 but haven't installed it yet. I suppose I should go ahead and  do it. I need to support a couple of older programs from this station tough. So, I'll have to be sure that I can run those programs without (any) much modification.

Once I get LV 8 installed, I'll have a look at your sample VI
~~~~~~~~~~~~~~~~~~~~
Paul Johnson
Renco Encoders, Inc
Goleta, CA
~~~~~~~~~~~~~~~~~~~~
0 Kudos
Message 7 of 12
(3,685 Views)
You may want to add a timeout or an operator canel/override button if you go for a polling loop in case the machine never completes it operation.
~~~~~~~~~~~~~~~~~~~~~~~~~~
"It’s the questions that drive us.”
~~~~~~~~~~~~~~~~~~~~~~~~~~
0 Kudos
Message 8 of 12
(3,678 Views)
Good idea, thanks.

I must admit, I'm tempted to use the event stucture method, if I can get LV 8 up and running.
~~~~~~~~~~~~~~~~~~~~
Paul Johnson
Renco Encoders, Inc
Goleta, CA
~~~~~~~~~~~~~~~~~~~~
0 Kudos
Message 9 of 12
(3,674 Views)

Hey Paul-

Either way, the other suggestions in this thread are great and should work well.  Let us know how it works out

Tom W
National Instruments
0 Kudos
Message 10 of 12
(3,667 Views)