Signal Conditioning

cancel
Showing results for 
Search instead for 
Did you mean: 

Trigger an event in my program using a Scc-DI01 module?

Hello,
 
I am trying to trigger an event in my program uding a SCC-DI01 module in my 2345 carrier. My daq card is only supported in traditional NI-DAQ. I am new to labview so any help would be appericated.
 
Thanks,
Paul
0 Kudos
Message 1 of 7
(4,000 Views)

Hello Paul,

Are you able to read your digital signal with the SCC-DIO1?  If you need help doing this, I would look at the digital input examples in the Example Finder that can be found by going to Help >> Find Examples in LabVIEW and then browsing to the Hardware Input and Output >> Traditional DAQ >> Digital Input and Output >> E Series.     

Once you are able to read the digital lines, you can use a while loop and a case structure to poll for the state of the line.  If the line goes to high (or low, depending on your choosing) you can execute the code inside the case structure.  Depending on the Digital read function you use, you may have to get a particular element from an array that corresponds to the correct line as is the case with the example Read from 1 Dig Port (E).VI.
 
Let us know if you have additional questions about this.
 
Regards,
Laura
0 Kudos
Message 2 of 7
(3,987 Views)
Hello,
I was able to get an input from the DIO module. A led will light on the front pannel when the signal goes high. But I cannot get the event structure to run event I want to run when the led goes on. I configured the event to operate when the indicator changes state but this does not run the event. 
 
Thanks again for the help
 
Paul
0 Kudos
Message 3 of 7
(3,984 Views)

Hi Paul,

I believe that the problem you are experiencing is due to the fact that the Event Structure is intended to capture user events, and not programmatic events.  This KnowledgeBase discusses this issue and a workaround.  Please take a look at it and post if you have other questions.

Best Regards,
Megan B.
National Instruments.

0 Kudos
Message 4 of 7
(3,977 Views)

Hello,

I changed my program to use the case structure instead of the event structure. I was able to trigger the case when my didital module received a high signal. Thanks for the help. But this uncovered another promlem I now have. If the signal on the DIO module stay high for too long the event will trigger again. There is a do while loop around my program so after the event in my case is complete and the DIO is still high the case will trigger again. Is there a way to triger the case only once for every signal the DIO module receives?

Thanks,

Paul

0 Kudos
Message 5 of 7
(3,967 Views)
Hello Paul,

As you mentioned, this behavior is expected since your application is polling a particular variable.  If the variable stays the same after multiple executions of the loop, the same case will execute multiple times.  So I would suggest adding a delay to your loop which accounts for the maximum time a particular pulse will stay high or low so you're guanteed that after a loop iteration, the value at the case selector will be the next pulse.

Hope that helps.
Wendy L
LabWindows/CVI Developer Newsletter
0 Kudos
Message 6 of 7
(3,949 Views)

Hello,

I was able to get the trigger to acticate the case structure only once for every contact of the limit switch. I used the shift register on the do while loop. When the status of the limit switch changes the previous loop has a different value in the shift register. A comparison of the 2 shift register is made using the boolean implies function then the out put of the implies function is connected to the case structure.

This forum was very helpful for me.

Thanks again,

Paul

0 Kudos
Message 7 of 7
(3,944 Views)