LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to display a signal in waveform graph from serial port with this protocol?

I am new user of Labview 8.0.
 
I need to display a triangule waveform signal,
generated by an external hardware plugged at serial DB9 COM1 (kit 89C2051)
asynchronous
data format is that: 
 
byte1 MSB: 1  0  0  0  0 b9 b8 b7
byte2 LSB: 0 b6 b5 b4 b3 b2 b1 b0
 
I will need a 10 bits A/D (can be a 12)
 
 
What blocks and VIs i am supposed to use?
VISA is only for standart protocols such RS-232?
 
 
thanks!
 
p.s.:
sampled at 1024Hz
baud rate = 38400bps
data bits = 8
parity = none
stop bit = 1


Message Edited by frotico on 05-17-2008 07:56 PM
0 Kudos
Message 1 of 12
(5,090 Views)

Hi frotico,

      The attached VI may help get you started.  It won't work if you need a timestamp with each sample!  It reads 200 bytes at a time, converts them to 100 (binary) values and plots them.  You probably have a scaling factor to convert these values to analog values(?)

Cheers! 



Message Edited by tbd on 05-18-2008 03:19 AM
"Inside every large program is a small program struggling to get out." (attributed to Tony Hoare)
0 Kudos
Message 2 of 12
(5,068 Views)
ow! thanks!
it was very helpfull!
=]
 
I am studing the blocks and VIs.
 
I understood the logics, but not the way they are linked in LabView.
 
(from serial.vi attached)
IF byte=MSB, THAN
  enter the CASE structure
END
Is the error out from CASE structure that warrant that the 1st byte in WHILE loop is MSB? (I've to study error signal in general!)
 
The decimate 1D array keep the byte array at the output or it is a multiplex?
 
Thanks again!
 
 
 
 
 
0 Kudos
Message 3 of 12
(5,033 Views)
I am with the kit now.

the VI doesn't work.

serial loopback test is 0k.

Could someone help me perform a more simple test of read?

0 Kudos
Message 4 of 12
(5,015 Views)
please!!!!
0 Kudos
Message 5 of 12
(4,986 Views)
Use one of the serial read write examples you can find through example finder to do a basic read of the data.
 
Other than that, you will need to provide some more information as to how it is not working.  Are you getting an error message?  If so, what number and description?
 
The attached VI just reads data coming in from the serial port.  So a serial loopback test isn't really going to help you.  Is there a command you have to send to the device to get the data flowing?  Something you have to press on its front panel?
0 Kudos
Message 6 of 12
(4,983 Views)

Hi frotico,

Just one comment about the VI previously attached, you may (or may not) have noticed the unwired input connectors to "VISA Configure Serial Port".  I believe it defaults to 9600 baud, 8 data bits, 1 stop bit, and no parity.  Drag the wiring-tool arond the edge of the SubVI to see it's input (and outptut) connector-names.

If you haven't done so yet, wire a numeric 38400 to baud rate and a boolean FALSE to "termination character" - for that matter, it's good practice to wire all the critical inputs so if the configuration-VI's default-values are accidentally changed, your program will still work. Smiley Wink

Sorry for late response, I have no time during the week, though, Ravens Fan is a LabVIEW guru and can surely help you!  Smiley Happy

Cheers

 

"Inside every large program is a small program struggling to get out." (attributed to Tony Hoare)
0 Kudos
Message 7 of 12
(4,975 Views)
I tried again example 'Basic serial and read.vi', but it only performs the loopback.
 
There are no error message: the VI play and nothing happens.
 
I hope that if loopback test is 0k, my VISA driver and my serial port are 0k too!
The RS-232 cabe is 0k.

When i turn on the kit, it starts to send data. It generates continued signal from a infinite loop. (the kit have only a reset switch)
So, there aren't both software and hardware controls to do.

----

I'll try to plot in waveform graph data from a text file (bytes like the kit send)
and try to do a more simple serial test , do you have sugestion?


Thanks a lot!
0 Kudos
Message 8 of 12
(4,973 Views)
TBD!

I have noticed that baud rate always changed to 9600, so i forced 38400 as you told.

Termination character i did now,
a false constant => Enable termination char (T).

Even this way: nothig happen and no error message appear.

Thanks!!
0 Kudos
Message 9 of 12
(4,971 Views)
I forced now VISA resource name to COM1.

I tried giant values for loop, but the time that VI need to execute is always the same.
0 Kudos
Message 10 of 12
(4,970 Views)