07-22-2008 11:56 PM
07-23-2008 10:24 AM
11-04-2008 05:10 PM
Hi, I'm back!!
So my boss has asked me to modify this code to make it a bit more robust. I was thinking of setting up the PXI-2503 code so that when one trigger signal (say, trig6) is received, a relay (say, chan 12) closes but when a different trigger is received (say, trig7) the relay (ch 12) opens.
The old way I was setting this code up was with a single scan list which would close the relay, open the relay, close and then open, which works great if the signals coming into the RIO happen in the proper order but if they don't, this whole thing breaks down.
My question is: Is it possible to have one trigger line close a relay and then a second trigger line open the same relay on the same card using scanlists?? Or is there an easier way to do this?
Thanks,
John
Below is a more detailed explanation of what I'm trying to do if you care to read it!:
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
I wrote some RIO code a few months back (still haven't been able to test it though!) and had it set up so that when a specific signal ("ON Status") is received by the RIO, the RIO will send a pulse to PXI Trigger 6. Then when another signal is received by the RIO("OFF Status", it will send another pulse to PXI Trigger 6.
I have the PXI 2503 set up with a scan list that alternates between closing a relay channel and then opening that same relay channel. This is to occur 2 times (so there are 4 items in the scan list). This code is set up so that when it receives a pulse on PXI Trigger 6, it executes one item of the scan list. ie. relay is closed on 1st trigger pulse, opened on 2nd trigger pulse etc...
OK, the problem is, this assumes that the ON Status will always be the first signal received by the RIO and will only be followed by the OFF status, which will only be followed by the ON status...etc
My boss would like me to adjust the code so that the relay can be closed whenever an "ON" Status signal comes in and opened whenever an "OFF" Status comes in. This way, the 2503 can react more dynamcally to the signals coming into the RIO rather than be programmed for one and only one order of events.
11-05-2008 08:59 PM
Hello JTT844!
Thanks for your post and excellent questions about Switch triggering. So when you configure the switch to be triggered this can only be done in the scanning mode. So with that said you can only set one trigger input destination on the Configure Scan Trigger.vi. Even if you call this VI twice it will only set the last called function. Depending on how your trigger is coming to your PXI chassis from your C-Rio what you could do is set this to external and on your terminal block wire in both triggers to the trig in. This would require you to make sure that the triggers don't occur at the same time but this would allow you to get the close then open as you desire.
Another way I have done this before is to use a Digital Input module to bring in the triggers (Dev1/port0/line0 and Dev1/port0/line1). Then in software monitor the two lines and use the software trigger functionality of the Switch API to do your switching. So basically looking for a high on line 0 then closing ch0 then looking for a high on line 1 and opening ch0. However the drawback is that all of this would be in software so it would depend on how far apart your triggers are. Let us know if any of this helps and I wish you the best on your application!
Cheers!
Corby_B
http://www.ni.com/support
11-05-2008 09:19 PM
Hello again,
It looks like you mention from an earlier post that you have a 10us trigger that you are creating to do this. How far apart are your triggers? For instance if your R-series board and 2503 are in the same chassis you could always use the software switch functions to control the relays you want to open and close.
Cheers!
Corby_B
http://www.ni.com/support
11-06-2008 12:30 PM
11-07-2008 11:09 AM
Hello JTT844,
If that is the case that your triggers are 10ms apart then depending on your code you could just use the software functions and a case structure to open and close the relays as you desire instead of using the switch in a scanning mode. The Switch close/open vi's can take less than a 1ms in code time. If you are using Real Time this could go to an event fast time. Let us know if this helps you with your application!
Cheers!
Corby_B
http://www.ni.com/support
09-21-2012 05:42 AM
Hello,
I know this is a old post (2008), but I am also trying to handshake between a NI Switch card (PXI 2501) and R Series (PXI 7841R) using TTL0 for the trigger input and TTL1 for scan advanced output on the PXI 2501 and using PXI Trig 0 for measurement complete (trigger output) and PXI Trig 1 scan advanced input (trigger input) on the PXI 7841R. But when we run the code the scan advanced input on the PXI 7841R is always high. John in the post was trying to do something similar, but he mentioned that it was not tested. I am wondering if anyone has been successful with this approach?
Thanks,
Russell