LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Linear encoder

Solved!
Go to solution

Each individual slot of your device comes with an in built Counter for your modules to reference; this is the reason that your DAQmx task can retrieve Counter data.

This is incorrect.  The each cDAQ chassis has 4 total counters available (with the exception of cDAQ-9172, which has 2 as well as some additional module-to-chassis routing restrictions that are covered in the user manual).  Those 4 counters are shared between any module or chassis counter applications for which you program your chassis.

 


Then it goes back to my old question, why the counter does work when I simulate it? The 5th message in this post.

I do not understand this question.  Are you asking why it *does* work or does not?  You should be able to reference the counter at the module level using any counter-capable task.  OR, you can choose to reference the counter at the chassis level and then manually route terminals from the module to the chassis counters using the DAQmx API.  This is necessary because the default counter terminals for a chassis-addressed counter will almost certainly not overlap with the module terminals you are inderested in.

 

Did I misunderstand your question?

Tom W
National Instruments
0 Kudos
Message 11 of 33
(2,146 Views)

@Tom W [DE] wrote:

Each individual slot of your device comes with an in built Counter for your modules to reference; this is the reason that your DAQmx task can retrieve Counter data.

This is incorrect.  The each cDAQ chassis has 4 total counters available (with the exception of cDAQ-9172, which has 2 as well as some additional module-to-chassis routing restrictions that are covered in the user manual).  Those 4 counters are shared between any module or chassis counter applications for which you program your chassis.

 


My assumption was that for this general application, distribution of each counter per device slot would be suitable. I apologise that I neglected to mention their shared distribution applications through the use of a counter reference.


Alex Thomas, University of Manchester School of EEE LabVIEW Ambassador (CLAD)

0 Kudos
Message 12 of 33
(2,141 Views)

Hi Tom,

Sorry, I forgot to type 'NOT'. When I simulate counter, it does NOT work.

 

I have create a counter task, it still does NOT work.

8.png

0 Kudos
Message 13 of 33
(2,137 Views)

Thank you. I will try 9174

 

Have a great day!

0 Kudos
Message 14 of 33
(2,135 Views)

Hi lvymerciqq-

 

Can you clarify what you expected to see in your simulated device test panel window?  I do not see an error, so that indicates to me that the task is "working", but it might be worth noting that you should not expect to see realistic data there. 

 

Simulated devices present an interface to test basic functionality of your code.  For example, if you used Test Panels or programmed your device using DAQmx in a way that would not work (perhaps because of resource availability or routing capabilities on the device), then you could expect to see an appropriate and hopefully helpful error when you run your task.  But the data returned, if any, is completely fabricated in software and does not have any bearing on any actual hardware signals.

 

Hopefully this helps.  Good luck with your 9174-

Tom W
National Instruments
0 Kudos
Message 15 of 33
(2,131 Views)

I expect the # of measured value(s) to change according to the # of counter. Isn't it the output of counter0?

 

When I use Labview code to read the counter, there is nothing recorded.

0 Kudos
Message 16 of 33
(2,128 Views)

Hi lvymerciqq-

 

It's hard to tell from your screenshot, but it looks like you are using a simulated device.  So, there really isn't a device or an input to measure.  If you were using a real cDAQ chassis and module with a real digital input signal then you would expect to see the count increase and decrease based on the input.  Do you have a physical cDAQ chassis and module to test with? 

Tom W
National Instruments
0 Kudos
Message 17 of 33
(2,125 Views)

Hi Tom,

 

Our hardware is at site. I am debuging the labview code with simulated device.

 

With the hardware, we do get the counter values, but with the simulated device, we can't get any counter value. So My question is how can I change the simulated device settings to get counter work. According to Alex's reply, I am going to change 9411 to 9174, but the hardware we use is 9411. So I prefer to simulate using 9411.

 

Thank you!

0 Kudos
Message 18 of 33
(2,118 Views)

Hi lvymerciqq-

 

Thanks for the explanation.

 

You can not change the data behavior of simulated devices.  I'm also sorry to say that changing between the module (9411) and chassis (9174) will not change the data behavior.  If you need to test your data analysis code or other logic in the absence of the physical hardware you may need to find a way to simulate the data without making DAQmx calls for hardware access.

Tom W
National Instruments
0 Kudos
Message 19 of 33
(2,114 Views)

Hi Tom,

 

I have got another question. ctr1 doesn't work while ctr0 is working. I use ctr0 as the regular counter to count the edge and use ctr1 as the linear encoder counter. ctr0 works fine but ctr1 does NOT. When I swap counters, still ctr0 works(ctr1 does NOT).

 

Thank you

0 Kudos
Message 20 of 33
(2,100 Views)