LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Digital output pattern dilemma

I don´t now the best way to solve this so I turn to all you experts out there for help.
I´m using a DAQ-1200 card to control an external device. I have 1 analog input (An1) and 3 digital outputs (Dig1,Dig2,Dig3).

This is what I want:

1) As long as the An1 signal is > 0, all the digital outputs must remain high.
2) As soos as An1=0 I need the digital outputs to go from high to low in a specific pattern.

Pattern: (let t0 be the time An1 reaches zero)

1) At t0, Dig1 and Dig2 goes from high to low in 40ms and then back to high.
2) 16ms after t0, Dig3 goes from high to low in 18ms and then back to high

This pattern must be repeated every time An1 becomes zero.

Can anyone help me come up with a smart way to do this?
0 Kudos
Message 1 of 12
(4,135 Views)
Dependign on your timing restarints you may not be able to do this on a windows platform.

The issues is you want to detects something and then act based on that change for multiple outputs in different ways. Step 1) may be do-able using the analog trigger routed to a on board counter set-up to run as a single-shot. Part 2) is where it gets complicated. If you cannot handle it in a similar fashion to 1) software will have to get involved and in it the complication. Windows may let you respond in the time windows you outlined, but it also may NOT.

Check your boards capabilites because appropriately configured hardware is probably going to give your easiest path to tackling this project.

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 2 of 12
(4,135 Views)
My intention was to use the actual analog input signal as a trigger for the digital output. There´s an example that gives high and low signals to digital lines, just with pushing a button ("imediate dig. output to line" or something like that)
Isnt there a way of taking the input signal to a case structure, use the example vi:s inside the structure, and make the digital output high when false and my high/low-pattern when true. It has to work somehow, I just cant figure out how to use the "wait ms" function.
Am I totally wrong about this?

-Dawe-
0 Kudos
Message 3 of 12
(4,135 Views)
Yes there is PROVIDED your app has very loose timing requirements.

The software solution (what you are asking about) depends on windows allowing your app to run fast and frequently.

This is NOT a feature of windows.

If your timing req's are loose then a solution can be put together using software.

If they aren't, then we could tell you how to do it, only to find out that "It just does not work!"

The software approach would indeed be a combination of some of the examples that ship with LV.

You will want to do a continuous acquisition from the AI and compare the readings with your threshold "0". You will also want to track the time of the threshold and compare it with the current time to decide what should be done with the DO's.

If yo
ur timing req's are tight, The above can only pretend to do what your original posting mentioned.

How would you system to react to the DO that should be delay 16ms to periodically take 150ms?

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 4 of 12
(4,135 Views)
I would recommend using the right tools for the right jobs. I would contact some-one with knowledge on micro-controller programming. Low-cost programmable logic will give you a firm real-time solution at low cost.

Patrick de Boevere
Serenity systems design
0 Kudos
Message 5 of 12
(3,965 Views)
I would recommend using the right tools for the right jobs. I would contact some-one with knowledge on micro-controller programming. Low-cost programmable logic will give you a firm real-time solution at low cost.

Patrick de Boevere
Serenity systems design
0 Kudos
Message 6 of 12
(3,965 Views)
Ben wrote in message news:<50650000000500000082A20000-1031838699000@exchange.ni.com>...
> Dependign on your timing restarints you may not be able to do this on
> a windows platform.
>
> The issues is you want to detects something and then act based on that
> change for multiple outputs in different ways. Step 1) may be do-able
> using the analog trigger routed to a on board counter set-up to run as
> a single-shot. Part 2) is where it gets complicated. If you cannot
> handle it in a similar fashion to 1) software will have to get
> involved and in it the complication. Windows may let you respond in
> the time windows you outlined, but it also may NOT.

Personally, I'd consider attaching a hardware board with a few one-shots
on it. Signal A
fires a one shot to give a delay which fires the second
one shot giving the desired signal. No Windows timing to worry about.
But I suppose if you are going to add a hardware board, you could put
an analog comparator on there too and eliminate the need for the computer
and cards. 🙂

Les
0 Kudos
Message 7 of 12
(4,135 Views)
Nice of these guys to make all sorts of comments about problems you aren't having (yet).

Instead of using the Wait VI, if you realize this is just a wave form with transistions at 0 mS, 16 mS, 34 mS and 40 mS you can create your self a state machine that outputs the proper wave form based on the amount of time elasped since you triggered.

Attached is a VI (LV 6.1) illustrating the concept. The VI makes several assumptions about your application and therefore might be your exact solution, but should get you started.

Once you get the wave form out properly, you can contact us and tell if you are having any timing problems.
0 Kudos
Message 8 of 12
(4,135 Views)
Hi
I really appreciate that you give me an example to look at. Unfortunately I can´t open your example in my LV 6.0 version. Is there any chance that you can save it to an older version?

-Dawe-
0 Kudos
Message 9 of 12
(4,135 Views)
0 Kudos
Message 10 of 12
(4,135 Views)