PXI

cancel
Showing results for 
Search instead for 
Did you mean: 

How to use niSwitch_InitWithTopology with PXI-2567 relais card

Hello,

I'm trying to get the NI Visual Basic example niSwitchControllingAnIndividualRelay.vbp working with a PXI-2567 relais card.

I doesn't seem to get my ResourceName and Topology (the first two parameters of the niSwitch_InitWithTopology function) right (the example program creates the errors 1074130544 "This session is not valid" and 1074135030 "Failure loading driver module").

Where can I find the right ResourceName and Topology for the PXI-2567 (self test all right) to fill in these two parameters ?

With thanks,

best regards,

Geert
0 Kudos
Message 1 of 10
(4,948 Views)
Hi,
you can find all the info needed to correctly program your switch application in the NI-Switches online help located on your machine. In the help, look for your specific module. you should find a table that reports the correct string for the Init w/ Topology function and also the correct way to control each individual relay as far as sintax goes.

AlessioD
0 Kudos
Message 2 of 10
(4,948 Views)
Hello AlessioD,

thank you for your answer.

My problem seems to be finding the txtSwitchResourceName.

Where can I find this txtSwitchResourceName ?

Do I have to craete it in some way ?

For the other cards, I could use the device numbers to address the cards. Isn't this working for addressing a PXI-2567 relay card ?

With thanks,

best regards,

Geert
0 Kudos
Message 3 of 10
(4,948 Views)
Geert,
the txtSwitchResourceName for your case should be PXI::n where n is the device number for your module.
in the NI Switches Help you can find this information under
Programming with NI-SWITCH>>C/VB Function Reference>>niSwitch_InitWithTopology()

Regards
AlessioD
0 Kudos
Message 4 of 10
(4,948 Views)
Hello AlessioD,

thank you for your answer.

I've got the relay card being addressed now.

With thanks,

best regards,

Geert
0 Kudos
Message 5 of 10
(4,948 Views)
Hello AlessioD,

the relay card PXI-2567 stopped "working" again (I don't know why). So I checked the 'Tools' - 'Select switch card' from the Measurement and Automation Explorer with as result the error "Failure loading driver module" on 'OK'.

Seems that the driver module of this PXI-2567 can't be loaded. NI-switch 32.dll gives the same error report from the Visual Basic sample program.

What can be the problem and how to fix it ?

With thanks,

best regards,

Geert
Download All
0 Kudos
Message 6 of 10
(4,948 Views)
Hi Geert,

It looks like this is a driver problem. Which version do you have of NI-DAQ and NI-Switch? If you have Ni-DAQ 7.2, than older versions of NI-SWITCH can cause problems. Make sure that you download the latest version from our website.

I took a look at your code and I can't find anything wrong with your initialization step, so the problem is not related to your program.

Regards.

Joris Vanderschrick
Applications Engineer
NIBE
0 Kudos
Message 7 of 10
(4,948 Views)
Hello Joris,

it is a brand new NI-controller and NI had installed all hard- and software at delivery. Installed are Ni-DAQ 7.2 and NI-SWITCH 2.2. I'm using an other (real) PC (other than the NI-controller) to write the VB-software.

The NI VB-examples are from the delivered CD's, mentioning Ni-DAQ 7.1. So, indeed, it seems like the CD's delivered with the controller carry older software than the software installed on the controller itself.

I've done a normal VB setup.exe of the VB-program (the NI-example mentioned above) after compilation.

Which driver(s) should I install (if possible only the needed software and not the all CD's, the controller has no CDdrive and we do not want to connect to our network
for security reasons) to get the PXI-2567 up and running from VB (and from MAX - Tools - NI-SWITCH Soft Front Panel.exe) ?

I'll contact NI Belgium also directly about this problem.

With thanks,

best regards,

Geert
0 Kudos
Message 8 of 10
(4,948 Views)
Geert,

You can download the latest ni-daq 7.2 driver from our website. This also includes the new NI-SWITCH driver with the new VB examples. To install NI-Switch and/or the device documentation, create a second temporary folder on your local hard drive and extract NIDAQ720CD2.zip into it. This will create the installation files necessary for installing NI-Switch and/or the device documentation.

Please go to the link below:

http://digital.ni.com/softlib.nsf/websearch/50F76C287F531AA786256E7500634BE3?opendocument&node=132070_US

When you have installed this on your Desktop PC, you are sure that you're driver versions are matching. NI-switch 2.2 will only work with NI-DAQ 7.2.

I hope that this fi
xes the problem.

Kind Regards.

Joris Vanderschrick
Applications Engineer
NIBE
0 Kudos
Message 9 of 10
(4,948 Views)
Hello Joris,

I've checked the version of all niswitch_32.dll on the controller and the 2.1 and 2.2 were (from the VB-install) mixed.

I've replaced all 2.1 by the one resting 2.2 niswitch_32.dll and unregistered the 2.1 and registered the 2.2 version with regedit.

Now the VB-example is working fine.

Thx everybody for the help.

Best regards,

Geert
0 Kudos
Message 10 of 10
(4,948 Views)