LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

check the source code in absence of physical Hardware

For one of my applications, i have to work with 4 counters.So i increased counter input channels from 2 to 4 in the source code. But we are yet to get the hardware as we have a PCI card which can read 2 counters. But before we go for the hardware purchase, i want to make sure my source code which has 4 counters work.
I want to know whether there is any provision to check increased counter channels functioning.
Pls give me suggestion & procedure if you have any for this type of issues.
 
thank you in advance
 
-KIRIT
0 Kudos
Message 1 of 12
(3,379 Views)

Hi KIRIT,

to check your code you can simulate your input. Change your function which read from the hardware with a vi in which you can simulate the hardware. Another solution could be to use a simulated device. You can create them in MAX.

Hope it helps.
Mike

0 Kudos
Message 2 of 12
(3,376 Views)

Thank you

Can you pls tell me the procedure to interface the source code to simulated device in MAX.

0 Kudos
Message 3 of 12
(3,369 Views)

Hi Kirit,

go to MAX, right click on "device and ..." and select "NI-DAQmx simulated device". Select the device. Now you can select it in your source code.

Mike

0 Kudos
Message 4 of 12
(3,365 Views)

Mike

I picked a simulated device(Ni PCI-6601) in Ni-daqmx devicesI which has 4 counter channels. And placed DAQ Assitant in block diagram, initializing the counter input with acquiring signal. Same channels from MAX and DAQ Assistant are picked, but i see no communication.....For example if i give some counter value on the front panel it should reflect on MAX generated simulated device.But i see no change.

I am sending you the screen shot of the both MAX and labview program.

Pls post your suggestions

 

 

 

0 Kudos
Message 5 of 12
(3,354 Views)
There won't be a change in the count. The simulated device option is primarily there to check for errors in setting DAQmx properties and not for data generation. If you want to simulate data, then the only option right now is to write your code and call that instead of DAQmx/DAQ Assistant.
0 Kudos
Message 6 of 12
(3,335 Views)

It would be very nice, if u can give details how to do......with an example if possible

Thank you

Kirit

0 Kudos
Message 7 of 12
(3,330 Views)
I'm don't know how you are using the counters - frequency, pulse width, edge count, etc. Simply putting a random number generator and scaling it will do for some situations. Using a constant will work to. Do you need to simulate when only a passing result is returned or both? What is failing data? In the case of a counter, it's a simple numeric returned and that does not require anything too fancy in the subVI you create.
0 Kudos
Message 8 of 12
(3,326 Views)

 

I am using counters for Edge counting. I need to simulate in both situations like passing result is returned. I am not sure of what you meant by failing data.........i am stuck at that position...when i use digital input with the same worksheet it shows response but with counters no response. Pls if possible send me the woksheet you believe would work(like with random genrator and so on). Actually i am not looking for too  fancy.....My intension of doing this simple thing is to get a way to communicate with the built in simulated devices. Then i want to simulate it with the source code which i have modified with new counter inputs.

KIRIT

0 Kudos
Message 9 of 12
(3,304 Views)

Do you not know what the typical measurement is supposed to be? By failing data, I mean a measurement that is outside what you would expect. You need this if the count is supposed to be some value and you have code that takes some sort of action when it is outside a limit. If you don't really care, then just set it up to return a range of nominal values.

Below is some simple code to generate a random number between a min and max range. You can replace the min and max with constants or just have the random count be a constant.

I hope you are aware that the simulated count function would be used in place of the DAQmx Read/DAQ Assistant. For counters, you cannot use a simulate DAQmx device to return anything but a 0. You could have a case statement with one case having the DAQmx function and the other case having the simulated data function.



Message Edited by Dennis Knutson on 07-24-2008 01:05 PM
0 Kudos
Message 10 of 12
(3,296 Views)