Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

PCI 6534 for finite digital output generates output continuously

Solved!
Go to solution

Hi ,

I am using PCI 6534 for my application , where i generate digital output, a finite pattern of variable length in a loop continuously .  the code executes without any error but  i am not able to justify the behaviour of the card. I intend to use the code inside the while loop as a subvi and if i change the 'command ' array input during each call of the subvi , the ouput should vary as per the input of 1D array. 

 

But that is not the case , the loop outputs the previous value which has been given to the DAQmx write. though the  command array is changed the output instantaneously doesnt change. it takes  some time before the actual output changes. Also the lengths  of the command array  which i give are 88 & 133. When i realise that the output is  wrong , i disable the DAQmx write vi by a case structure, i expect an error that the output buffer is empty , but instead the old value is generated whenever the Daqmx start task vi is exectuted  without .

 

My understandng about the problem is that the output buffer is not getting overwritten by the new value , but i am  specifyng buffer size , performing a write each time and starting the task , waiting till the task is done and stopping the task. Each stop & write should clear and empty the buffer , but i dont understad what is going wrong. 

 

Also i thought might be that the commands are getting queued up in output buffer , acual generation is not as fast as calling the DAQmx write & start , but if that is the case then even if i pause the vi the generation shoud be on till the buffer is empty , but that doent happen ,  pause the vi then the generation pauses. the number of iteration is equal to the patterns generated. Can someone help as to what might be the problem ?  fiDAQ vind the code attached below.

0 Kudos
Message 1 of 2
(3,763 Views)
Solution
Accepted by topic author vagee

Hi, 

 

If I've correctly understood the problem that you are facing, then the reason for getting the typical behaviour when you execute this VI is that you are not clearing the DAQmx task each time you intent to go for a fresh DIO write. However you are just stopping the DAQmx task which doesn't seems to clear the onboard buffer space.

 

I'm attaching along with this post a sample VI which should work according to your expected behaviour. You can even call this VI as a subVI and can use it to update the DIO port with a fresh variable length digital pattern. Another fact which I would like to point out to you is that once you have initalised an array, it's not possible to decrease the array length. You can only increase it by appending new elements. As per your requirements since the digital pattern that needs to be updated is going to be of variable length, each time you cll the subVI, you should create a freash array of appropriate length and feed it as an input to the subVI .Inside the subVI, depending upon the length of the this array input appropriate buffer space is allocated.

 

Trust this solution help you resolve the issue, if not feel free to revert back.

 

Warm Regards,

 

Sagar G Yadav | Application Engineer | National Instruments - India 

0 Kudos
Message 2 of 2
(3,748 Views)