Switch Hardware and Software

cancel
Showing results for 
Search instead for 
Did you mean: 

NI-2530B Switch Scan List

I am having issues with the 2530B reading in my scan list. I have had no issues until now. In Test Stand I create a scan list, Example: "ch0->com0 & com0->pcom1 & ch16->pcom1;". When I intialize, configure, initiate, etc the switch acts correctly. When I send it a scan list, Example: "ch0->com0 & com0->pcom1 & ch16->pcom1; ~ch0->com0 && ch1->com0;" (With mode using Software Trigger) it does not read anything in the list and does not open/close any switches. I have used this switch for awhile now but some odd reason I am having issues with it right now and can not figure it out.

 

To go a little farther, I use GetRelayPosition to step through each relay to check after I initiated the scan. When I use the second example scan, I get a response back of NISWITCH_VAL_OPEN (10) for all relays, but when I use the first scan, the one that works correctly, I get no repsonse back from GetRelayPosition and the return value stays at '0'. Everything seems odd. I have been using the Switch for months now and created hundreds of scan lists of different types but not sure why I am having these problems now.

0 Kudos
Message 1 of 9
(8,093 Views)

Trey,

 

Are you getting an error?

Is your device configured for "No Action" Scan Mode? This is required to be able to use the disconnect action [Switches Help]?

 

How are you using the "GetRelayPosition" VI? When a switch is in Scan Mode you should get error "-1074126842" with the explaination "The switch module is currently in scanning mode, and the operation cannot be performed at this time."

 

 

 

Frank,
National Instruments
Software Group Manager
0 Kudos
Message 2 of 9
(8,092 Views)

Not getting an error. I have initialized it as 2530/Independent, ConfigureTrigger to Software Trigger, Configured Scan List as NONE (No Action) and also Initiated the scan. It worked with the first example of the scan list as it sets the relays and I take a measurement with the DMM and it is correct. I have tried using GetRelayPosition after I aborted and it reads '0' for the position which I figure it should be reading '11' (Closed). Also tried to read GetRelayPosition after abort for the second scan list example, one that does not work, and each relay reads '10' (Open). Thing is I have used this for awhile now and for some odd reason it is not cooperating now.

0 Kudos
Message 3 of 9
(8,088 Views)

Hey Trey,

 

Reading the relay position is not supported while scanning. If I understand correctly, you have particular scan lists that work (first one in your example) and others that do not (the second), presumably in NI-Switch (looking at the syntax)?  Is it just this one module that isn't working correctly, or is this certainly a SW issue?  If you're familiar with the DAQmx Switching VIs, I'd recommend trying those out.  (Note the syntax is different and no session is required).  Also, can you post a small code snippit so we can look at it to get a better idea of the situation?  Thanks!

-John Sullivan
Problem Solver
0 Kudos
Message 4 of 9
(8,083 Views)

Correct about relay position while scanning, but once I abort I can check then also correct? If so, that is what I did and still got the '10' for the one not working correctly and '0' for the one that worked instead of '11'. I am using Test Stand and using niswitch32 dll to call the functions. I have my own dll I create the scan list in. And yes, when I include ';' output signal to wait for software triggers that is the scan lists not working correctly. IIf my scan list just contains one scan through, it works. Which is odd because I have been using this switch, funcitons, and my own scan lists for months and not sure why this is happening now. I can include some code but the only code would be creation of a scan list and I provided what it looks like above.

 

InitWithTopology ( "Name", "2530/Independent", False, True, handle);

ConfigureScanTrigger (handle, 0.0, software trigger (3), none (0));

Create My Scan List

ConfigureScanList (handle, list, none(0) );

InitiateScan(handle);

Measure from external dmm

 

When my scan lists look like:

com0->pcom1 & com2->pcom3 & ch16->pcom1 & ch32->com2 & ch1->com0 & ch49->pcom3;

The DMM takes the correct reading and everything works.

 

When my scan lists looks like (Or anything involving multiple triggers):

com0->pcom1 & com2->pcom3 & ch16->pcom1 & ch32->com2 & ch1->com0 & ch49->pcom3; ~ch1->com0 & ch0->com0; ~ch49->pcom3 & ch48->pcom3 &

It does not work and nothing responds. It does not stop at the first output signal ';' and wait for a trigger as I do not even get a reading like the first scan list.

 

0 Kudos
Message 5 of 9
(8,069 Views)

Hey Trey,

 

Can you verify that the same incorrect behavior occurs using the NI-DAQmx or NI-Switch API?  If our API's work and your custom DLL doesn't, then can you let us know if you've recently updated DAQmx/NI-Switch?

-John Sullivan
Problem Solver
0 Kudos
Message 6 of 9
(8,061 Views)

Don't think the issue is that my dll doesn't work as the only thing my dll does is create the scan list. Could have been an issue in the scan list though and after I completed the new code, looking back that might have been the case. What I did do that you mentioned was I re-coded everything using NI-DAQmx and after trial and error, I believe I got it to work. I ran Example 2 scan list and it seems it is communicating well with the switching and triggering. Thanks.

0 Kudos
Message 7 of 9
(8,056 Views)

Another question involving DAQmx. I am using the 2530B and want to create two tasks with seperate scan lists. When I use StopTask, it opens all relays. Is there a way I can pause task, which will keep relays in position, then start next task opening/closing relays?

 

Seems I will have to make one big scan list and use triggers unless I can pause a scan list, without reseting relays, and start another task scan list to open/close relays that will be used along with relays that were closed from first task.

0 Kudos
Message 8 of 9
(8,038 Views)

Trey,

 

Another question involving DAQmx. I am using the 2530B and want to create two tasks with separate scan lists. When I use StopTask, it opens all relays.

When you call StopTask it should take the switch back to the state it was in before "Initiate Task" was called. [ie if you close c0->r0, initiate scan, run through your scan list and abort the scan, it will return the switch in the state just before initiate was called (c0->r0)].

 

Is there a way I can pause task, which will keep relays in position, then start next task opening/closing relays?

Unfortunately there is no way to pause the task, keep the current state of the relays, or poll the state of the relay while a scan list is operating. The best solution would be to create a larger scan list, or store the final scan list connection and have that first connection in the new scan list be the last connected channel at development time.

Frank,
National Instruments
Software Group Manager
0 Kudos
Message 9 of 9
(8,032 Views)