02-22-2012 12:58 AM
I'm trying to make a subvi which has only 3 or 4 inputs and 1 error output to control the relay using state machine, as i've done it in the attachment
but this subvi is not working when i use it inside another vi, the relay closes for 1 second and opens itself but i want the boolean button switch in switch2.vi to
control the relay i.e to close when i press it and open when i release it and i'm using pxi 2567 relay module.Pls help.
02-22-2012 08:36 AM
I think the issue may be that you are initializing the device every time the subVI is called by the main VI. The "Reset Device (Boolean Value)" parameter of "niSwitch Initialize With Topology.vi" is not selected or changed in your application and reverts to the default value of "True". This causes the device to reset to its default value / state of an open relay each time the subvi is executed.
I would try and change the VIs to something similar to the attached file, with the "niSwitch Close.vi" and "niSwitch Initialize With Topology.vi" outside of the subVI and outside of the main loop.
02-23-2012 12:09 AM
Thanks for the solution, i changed the "Reset Device (Boolean Value)" parameter of "niSwitch Initialize With Topology.vi" to false in my subvi and that is also working fine.
04-17-2012 07:33 AM
Hi Chad Erickson,
I am using NI labview 2011 and PXI-1052 with NI PXI-2567 relay switch module. We are using PXI in RTOS mode.
In our project we have to control 19 relay switch, for that i am using 2567 relay switch topology for operate relays. We make a relay switch subVIs and using it in several places in one VI. Upto eight relay subVIs, the Real time system is working fine but when we are using more than 9 subvi the real time system getting hang and all communication getting lost and also some time we are getting deadlock error( i.e. appearing in RTOS screen).
Also the cpu 0 usage is arround 10 to 30 % and cpu 1 usage is around 80 to 100 % and the memory usage is not more than 7%. I have attached subVI and the error jpg file.
Why the system is getting hang? If u have any solution for this please let me know. We have required this solution very badly for our project. Please try to resolve it.
04-17-2012 12:01 PM
Is there a reason you're opening and closing the switch session each time you operate a relay? There's a lot of overhead creating and closing the session that might not be necessary. Also, I recommend making an array of channels that you want to open and close and then feed them into your loop... the boolean logic you're using now is likely unneeded (keep it if you like it). Also, is there a reason you're adding a 5ms wait between for loop iterations? The switch API has built in waiting, and your code appears to already have a 100ms wait under case 2. If anything, I'd recommend changing the waits to 'wait until next ms multiple'. The main issue, though, is likely that you're opening and closing the switch session each iteration.
Let us know what you find. Have a great day!
02-13-2013 09:55 AM
I am using a USB relay card USB4PRMxN (see datasheet attached). But I cannot get my head around how to control it with LabVIEW.
Can anyone help me with this please?
I found a LabwindowsCVI code on the manufacturer's website (attached), which works fine if this can help.
(I tried to convert it to LabVIEW but it did not work and I thought that it might be better to start from scratch for the Labview code anyway).
Thanks in advance for you help,
02-13-2013 01:21 PM - edited 02-13-2013 01:23 PM
You should not be hijacking an unrelated thread and you should not be posting to a board for NI switches. To keep things nice and clean, please post a new thread to a more appropriate board (Instrument Control probably). Attach the LabVIEW code that your wrote, even if it does not work.
Edit: Their website says they have LabVIEW examples. Why did you download the CVI examples?
02-14-2013 05:47 AM
Well I'm really sorry, did not mean to "hijack" anything, just thought that a thread on relay switch was appropriate.
The labview examples are for really old labview versions and different switch cards, so turned out to be very complicated and not working. This is what confused me at the start.
I now solved my problem, was really simple to code actually.
Sorry about that.