02-03-2014 12:55 PM - edited 02-03-2014 01:00 PM
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)
Run HWC Device.vi: (also attached)
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.
Solved! Go to Solution.
02-04-2014 10:50 AM
Through trial and error I was able to come up with a way to do this: