LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

BCD Reading

Hello,

Is it possible to read BCD using Labview alone or are DAQ cards
required?

I have a time code generator that outputs BCD that i want to read to
time stamp measurements.

If there are any resources that may help me or any pre written VI's
that any of you know about. Where abouts might they be found?

Thanks in advance for any responses!
0 Kudos
Message 1 of 3
(3,942 Views)
If the time code generator has a serial port output or a GPIB output
then you should read the time code using those communications channels.
BCD is simply a sequence of 8 bit binary numbers whose value is between
0 and 9. You can convert them to ascii by adding '0' to each byte. So
for instance, the output of the serial read will be a sequence of bytes
in string form. Convert this to an array of U8 bytes, then add '0' to
each member of the array, then convert the result back to a string.
Then, if you was to convert the string to a proper integer, use the
scanf function on the string. You may need to pay special attention to a
minus indicator or a decimal point. There is another form of BCD called
packed BCD. In this form each byte contains two binar
y coded decimal
numbers, one is the low nibble and one in the high nibble. This will
take more effort to decode into a string. The documentation for the time
code generator should provide detail on the output format. What is the
make and model?

If the generator outputs BCD as a voltage or current then you might need
some sort of DAQ card which makes the project a lot more complicated.

Neil wrote:
> Hello,
>
> Is it possible to read BCD using Labview alone or are DAQ cards
> required?
>
> I have a time code generator that outputs BCD that i want to read to
> time stamp measurements.
>
> If there are any resources that may help me or any pre written VI's
> that any of you know about. Where abouts might they be found?
>
> Thanks in advance for any responses!
0 Kudos
Message 2 of 3
(3,942 Views)
I've seen a few subVI's for BCD on the LabVIEW webring and other sites. The only one I remember now is the bcd.zip file available at

http://www.mooregoodideas.com/FAVIs/Strings.htm

They come in all sorts of flavours because they tend to be instrument specific. Attached is a vi (LV6.1) that I've used for serial comm with my PLCs since LV2 back in 1992 (packed BCD with reversed bytes).
=====================================================
Fading out. " ... J. Arthur Rank on gong."
0 Kudos
Message 3 of 3
(3,942 Views)