LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamically Change Ni HSDIO Channels

Solved!
Go to solution

I am currently using a PXI-6552 to generate and acquire I2C waveforms simultaneous.  I would like to know if it is possible (and how I would go about it) to dynamically change channels.  My goal is to just pass the two NI-HSDIO references (the purple variables) to a new subVI that I will create to change from 5 channels to a different set of 5 channels.  For instance:

 

Pseudo-Code:

 

initalize PXI sessions;

 

for(i = 0; i < 10; i++)

{

Set channels 0-5;

Run generate and acquire;

Stop acquisition;

 

Set channels to 6-10;

Run generate and acquire;

Stop acquisition;

 

Set channels to 11-15;

Run generate and acquire;

Stop acquisition;

}

 

close PXI sessions;

 

Basically I need the quickest way to switch acquisition channels without having to initalize and close the sessions every time. 

 

I am currently using the HWC functions downloaded in the .zip example from here: http://www.ni.com/example/31200/en/. (I also attached the two that are necessary for my problem).

 

Init HWC Device.vi:  (also attached)

init.png

 

Run HWC Device.vi:  (also attached)

 

run.png

 

 

I believe the VIs I may need are Assign Dynamic Channels, Configure Idle State, and Configure Initial State.  However I am not sure if those are the only ones.  If it is possible, do I have to close the original channels and then assign more?  Or does re-calling "Assign Dynamic Channels" automatically disable all non-assigned channels?  Etc.

 

The important things to note:  I am setting 5 channels at a time -- for both acquisition AND generation.   I need to close the channels and switch to 5 different channels -- for both acquisition AND generation.  All channels should be set to "z" state for high-impedance at all times.

 

If you need any other information, please let me know!  Thank you in advance for any suggestions/assistance.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If someone helped you out, please select their post as the solution and/or give them Kudos!
Download All
0 Kudos
Message 1 of 2
(2,514 Views)
Solution
Accepted by topic author MrHappyAsthma

Through trial and error I was able to come up with a way to do this:

 

code.png

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If someone helped you out, please select their post as the solution and/or give them Kudos!
0 Kudos
Message 2 of 2
(2,464 Views)