LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

reading photoplethysmograph waveform with serial port on PC using Labview

Solved!
Go to solution

Hard to say since you did not do what I asked.

 

I still think you are doing the conversion incorrectly with the index and concantanate instead of the join numbers but again, you did not provide some of the details.

0 Kudos
Message 11 of 17
(1,235 Views)
Solution
Accepted by topic author mahb

1. That graph image does not look like the values on the chart are going to zero. It looks to me more like a low value of a few hundred.

2. The "read string" indicator shows the last character as \FB which is supposed to be your termination character. The VISA Read does not include the termination character in the output string, so something is not working as expected.  I do not have the time to set up a special serial port test to try to emulate your system.  Were the termination character controls set before the program starts running?  The defaults values will not set the port the way you want.

3. Your string conversion does not appear to match the protocol specified on page 4 of the sensor document.  The Number indicator is not displaying 2236, which is how I would interpret the protocol for the values in read string. I have never seen a protocol like that. I do not think any of the standard string to number conversion functions will do what you want.

 

This code will produce the results described in the protocol.

 

Weird hex to decimal.pngconversion results.png

 

Lynn

0 Kudos
Message 12 of 17
(1,232 Views)

So many Thanks. your suggestions helped me alot.

0 Kudos
Message 13 of 17
(1,206 Views)

 

Hi every body,

 

Wish you all a happy and bright new year.

 

I am reading signal through Serial port.  When I am trying to save my file into text file Sampling frequency is changing and it is not constant while device is sending 1 frame every 10 MS.

 

First I faced a problem that time stamp was repeating for some points while signal kept changing.

 

I solved that problem by putting a case structure and time delay function for about 1 MS and it is solved. Even though I am not sure this make program miss the data or not. Device is sending every 10 ms one frame.

 

Thanks for your help.

 

 

Download All
0 Kudos
Message 14 of 17
(1,131 Views)

The way I read your protocol, it looks like it sends one frame, waits 10 ms, and then sends the next frame. That makes the period 12.86 ms.

 

Since each frame ends with the ETX character and it appears that the data cannot contain that value, use ETX as the termination character.  Then you can set the byte count to a larger value and eliminate the delay.

 

Write to file may take more than 12 ms. Consider a Producer/Consumer architecture and writing larger amounts of data but less often.

 

The OS and the resolution of the Get Date/Time function may also be factors. Look at the simple timestamp checker I have attached.  On my computer the timestamp differences range from 12.6 ms to 14.3 ms with a nominal delay of 13 ms. With a delay of 10 ms the differences range from 9.6 to 11.4 ms.

 

Lynn

0 Kudos
Message 15 of 17
(1,116 Views)

Dear Lynn,

 

So many thanks for prompt reply.

 

I can't see the attached file. Thanks for your help.

 

Regards,

 

0 Kudos
Message 16 of 17
(1,110 Views)

I think it would be easier for you to see it if I actually attached it!  Sorry.

 

Lynn

0 Kudos
Message 17 of 17
(1,102 Views)