LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Example to simulate transducer encoding

Labview (version 6i)newbie needs help. I’ve searched the documentation but am having trouble getting started. I want to create a transducer simulator. Transducer output is 16 bit with 0 being 40 usec and 1 being 80usec with 40usec high signal between bits. There is about 6 msec delay after power is applied until the signal is transmitted. I’ve looked at the pulse train VI’s but they don’t seem to be able to change the pulse width. Basically, the data flow would be: user inputs transducer valueconvert to Boolean arrayconvert to pulse trainoutput.

Any help would be appreciated.
0 Kudos
Message 1 of 10
(3,315 Views)
I do not completely understand your bit pattern, but it seems as though the basic time interval is 40 us. Perhaps you could create a mapping process: a zero produces one 40 us element, a one produces two 40 us elements, and the separator is a high 40 us element. Then convert your 16-bit pattern to a bit array, feed the array through a for loop and create the pulse output pattern by the mapping process above. You could feed this to a digital output for simulating your transducer.

Lynn
0 Kudos
Message 2 of 10
(3,302 Views)
I think you understand it pretty well. Here is my attempt. Something is messed up but I feel I'm making progress. Thanks for your help and any further help would be appreciated
0 Kudos
Message 3 of 10
(3,297 Views)
The VI you posted seems to already very closely match your requirements. I have made a couple of small changes and attached it to this post.

Good luck with your project!

Scott Y
Applications Engineer
National Instruments
0 Kudos
Message 4 of 10
(3,280 Views)
Thank you for your interest, but I don't have labview 7.1. Could you please save it as 6? Also my latest version is attached. My next steps are to "decode" the pulse and then figure out how to test it with the HW. Thanks for the support
0 Kudos
Message 5 of 10
(3,266 Views)
Attached is a copy of the VI saved for LabVIEW 6.0

Scott Y
Applications Engineer
National Instruments
0 Kudos
Message 6 of 10
(3,255 Views)
Yes - Much cleaner 🙂

I've been fooling around with basic trigger.vi to measure the pulse width. In the real appllication the HW reads the falling edges and compares the pulse width to 100usec (>100 = 1, <100 = 0), but I can't seem to get it to recognize multiple triggers. Any pointers would be welcome.

ps How to award stars?
0 Kudos
Message 7 of 10
(3,247 Views)
The example attached to this email demonstrates how to detect and count edge transitions of an analog signal using software. Using a similar method you should be able to measure the pulse width of individual pulses generated by your simulated transducer. I had to back save it from 7.1 several times to get it to run in 6.0, but it appears to have saved without any issues.

Regarding rating messages, the following information is available in the help link at the top of this page:

How do I rate a message?
Please take the take the time to rate helpful messages. To do so, log into the Forum and look for the Rate This Message (Thread) feature at the bottom of messages and threads.

Note: authors cannot rate their own messages and users may rate a specific message only once. All ratings are automatically averaged.

Scott Y.
AE
National Instruments
Message 8 of 10
(3,221 Views)
Thanks, I'll take a look at it. However, I think I'm approaching my level of compentency. What's the fastest scan rate? I guess I'd have to sample above the the Nyquist frequency to get the transitions.

See attached for a software simulation - next step is I/O...
0 Kudos
Message 9 of 10
(3,214 Views)
The following Tutorial has a lot of good information about analog sampling considerations, including the minimum sampling rate.

If you have any additional questions, please post them in a new thread to get the most visibility in the discussion forums.

Scott Y.
National Instruments
0 Kudos
Message 10 of 10
(3,179 Views)