08-29-2022 05:51 PM
I found a similar post on this, the user found the only way to do so was to start and stop the task.
I've tried:
- adding stop task at end
- putting case structure around start task
- putting case structure on start and stop tasks
In all situations it just keeps incrementing. I wish there was a property on the channel that allowed for reset but I cannot find one for distance count, just edge count.
Any ideas? thank you.
Solved! Go to Solution.
08-29-2022 08:12 PM
Can you describe your problem & desired result in more detail? It'll also be helpful to post actual code, preferably saved back several versions to maybe LabVIEW 2018 or so.
You might be up against a hard limit, one that I was griping about more than 15 years ago. And which wasn't changed in subsequent generations of devices.
While newer devices *do* support count reset in edge-counting mode, encoder position mode still demands a z-index signal that's sync'ed to the encoder's A,B channels in a specific way.
What DAQ device(s) do you have available to use? What's the purpose and need for the count reset?
-Kevin P
08-30-2022 01:34 AM
I can only comment on what I see in the pictures.
You have set 'z index enable' = 'false'. I think this should be set to 'true'.
In your image there is a comment about scaling which should not be required.
I think the value for "distance per pulse" of 12363 inches is way too large.
08-30-2022 03:29 AM
I agree that there should be a way to trigger the count reset from software, but if there isn't, why not grab the current count and the point you trigger in the software and subtract it from the hardware total.
0xDEAD
08-30-2022 10:20 AM - edited 08-30-2022 10:30 AM
Attached is my code (Labview 2019 SP1)
In a previous iteration, I did do a zeroing by subtracting the count.... I am worried about the effectiveness this method, especially if running for large amounts of time, which is why I'm trying to figure out how to stop and restart the task. This seems doable in a contained loop, but I have it 'spread out' a bit in my program because I have a part that syncs up several acquisitions (the flat sequence structure).
08-30-2022 11:45 AM
@downerdce wrote:
I found a similar post on this, the user found the only way to do so was to start and stop the task.
I've tried:
- adding stop task at end
- putting case structure around start task
- putting case structure on start and stop tasks
In all situations it just keeps incrementing. I wish there was a property on the channel that allowed for reset but I cannot find one for distance count, just edge count.
Any ideas? thank you.
What is that thing crawling up the side of your hugely oversized VI?
08-30-2022 11:57 AM
It is a tower housing the eye of sauron.
08-30-2022 12:12 PM
Actually a not really fun implementation of OPC comms.
08-30-2022 06:23 PM
@downerdce wrote:
Actually a not really fun implementation of OPC comms.
I was going to say that if you could somehow get rid of that thing, you could end up with a very reasonably sized block diagram. I like your previous post. It made me literally LOL. 😄
09-07-2022 11:03 AM - edited 09-07-2022 11:04 AM
Here's the solution if anyone is interested. VI is attached in case you don't get it from this snippet.
Had to stop and restart the task with a button (or some other event) inside of my while loop. Thank you labview tech support.