Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Writing a Program using Labview and USB-6009

The example that was posted earlier IS the program that I am referring to.  I've made a few cosmetic changes, but the program is mostly the same.  Here it is:
0 Kudos
Message 11 of 23
(4,147 Views)

Hi Matt,

I tried that code that you sent me and it does not seem to function like you stated.  Also, I tried changing the code but it seems that there is some strange behavior with two Elapsed Time vis used.  I have not found a way around this yet but you could utilize a flat sequence structure inside of your for loop which would make the line high, hold it for some time, drive the line low, hold it for some time.  This is not very elegant but should get the job done.  Once again, I tried this code out with some slight modifications and found that it ran once with no problems but would keep the previously stored value of the Elapsed Time.  I will check into this a little bit further but please let me know if the sequency structure will do or if something like a counter could work in this application as well. 

0 Kudos
Message 12 of 23
(4,129 Views)

Let me try this again.  I was give a program by one of the NI engineers named Dennis.  The program is Basic Software Timed Digital.vi, and it is exacty what I need except for one small problem.  This is a program to control a TTL signal, and it is programmed so that the low signal lasts twice as long as the high signal.  This works for times under 5 minutes, but at 5 minutes and greater, the signal will cycle once, and then freeze at the high signal.  I need to run the program for 15 minutes on high and 30 minutes on low. 

 

Please help.

 

Here is the program that I have been running.

0 Kudos
Message 13 of 23
(4,088 Views)
I am not an NI engineer and I think everyone sees the problem with the Elapsed Time function and I for one, do not undertand why it works at the smaller time intervals.  Frankly, I don't have the time to spend testing a program that will take 45 minutes for each iteration. Have you tried the alternate with a sequence structure? Have you tried an alternate time function?
0 Kudos
Message 14 of 23
(4,069 Views)
The way this program works, the signal immediately rises when the program is turned on.  How do I change this so I can control the start of the program by an ON/OFF push button on the front panel? 
0 Kudos
Message 15 of 23
(4,027 Views)

Hi Matt @ ICS,

 

If you want to delay the start of your application, you can place your code in a large case structure with a start control and put all this in a while loop. Like this, your program will continuously be running the False case until it receives the start button, in which case, it will run your main code. Just make sure to you share the stop condition wire for both inner and outer while loop.

S_Hong
National Instruments
Applications Engineer
0 Kudos
Message 16 of 23
(4,008 Views)

I am having problems connecting both stop icons to the same source.  Starting from the outside and going in: i have a while loop, case structure, for loop, while loop, and case structure.  I'm trying to connect the source inside the inner case structure to both of the stop icons associated with both while loops.  When I do this I get the following error:

 

Array element conflict.
The type of the source is 1-D array of boolean (TRUE or FALSE).
The type of the sink is boolean (TRUE or FALSE).

 

I don't want to add a button to stop the program.  Before I added the outer while loop and case structure, the program would cycle N times, then end itself.  I would still like for it to end this way.  I've added the outer case structure and while loop because I also want to run the program, but not have the program start until I press a button on the front panel.

0 Kudos
Message 17 of 23
(3,992 Views)
It sounds like you wired the stop condition out from the for loop. LabVIEW basics - a wire leaving a for loop is automatically indexed into an array. Right click on the wire leaving the for loop and select 'Disable Indexing'.
0 Kudos
Message 18 of 23
(3,981 Views)

Hi all,

During i have doing a project which is using the digital output of usb6009 to control the relay driver circuit. But, i dont know how to contruct the block diagram. I have try doing it but cannot see the expected result. Need you advise here.....

Appreciate you all help!

 

Thank you,

aloon......

Download All
0 Kudos
Message 19 of 23
(3,601 Views)
Your VI has some strange things in it. The way you've written it, you can't turn the Boolean output to false and I don't understand at all why you are writing an array to the DAQmx Write. Try this simple VI.
0 Kudos
Message 20 of 23
(3,589 Views)