LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

a daq counter

hi all

i have a motor with an encoder connected to a 6024 card
i am using the daq assistant to aquire the digital counter signal from the encoder
when the counter counts down from 0, it will go to a value 16777215 which is the max positive number of the daq data output
however i desired to get -1,-2 ... instead
is there any way to configure the daq data output to generate negative values besides adding in more vis to solve the problem?
0 Kudos
Message 1 of 6
(2,753 Views)
Hello Leongchuan,

The only way to convert this to a negative number is to monitor the count to see if a rollover has occurred, then subtract 2^24 from the count if it has. I have attached an example VI which demonstrates how to do this. This should work for your E-Series board with a 24-bit counter.

Let me know if you have any further questions...

Sean C.
Applications Engineer
National Instruments
Message 2 of 6
(2,729 Views)
hi Sean

I have tried your vi and it works fine
however the counter does not count as accurate as before
after 10 or so revolution the counter began to lag in its counting whereas my previous counter works perfectly beside the rollover problem
is it because of the feedback?
0 Kudos
Message 3 of 6
(2,706 Views)
Does the counter begin to lag when counting positive numbers, or is it only when going negative? When it is counting positive numbers, the rollover code is bypassed and the VI behaves the same as the previous version. If this only happens in the negative numbers, then there must be something wrong with the rollover code.
Message 4 of 6
(2,685 Views)
hi Sean
another problem is that I will be using the counter in a Simulation Module.
However I tried placing the example into the simulation loop and I had problems with the feedback part.
It seems that I am unable to form a cycle. And also I can't use shift registers in the simulation loop to provide the feedback.
So is there any method to use the example code in the simulation module?
0 Kudos
Message 5 of 6
(2,680 Views)
Hi,

What do you mean by "Simulation Mode"? It would be nice for you to post the code so we can see what you are looking at.

Thanks,
Sal
0 Kudos
Message 6 of 6
(2,669 Views)