LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

zeros between values visa serial read

hello everybody

 

my program gets the signal from a load cell trouhg a PIC 16f876A and put it in LabView. Everything seems to be rigth, and the values I read are ok, but between every value there is a 0 (zero) value. I don't understand what could be happening. I take the signal with VISA at 9600 baudrate.

 

Please if someone knows what could be going on it would be very nice.

 

Thank you all!!

 

Attached I leave my vi with sub-vi

0 Kudos
Message 1 of 11
(3,130 Views)

Where exactly are you reading 0 at?  Your Bytes at Port function is not wired to anything, but I suspect the 0 is coming from your buffer when you do a serial read.  If the button is empty and your PIC has not data to present, it will return 0.

-----------------------------------------------------------------------------------------
Reese, (former CLAD, future CLD)

Some people call me the Space Cowboy!
Some call me the gangster of love.
Some people call me MoReese!
...I'm right here baby, right here, right here, right here at home
0 Kudos
Message 2 of 11
(3,119 Views)

Hi MoReese, 

 

In fact I am pretty new to LV, so it's kind of difficult to know excatcly where I am reading a zero. 

Could you please tell me how do you think that bytes at port should be connected or, if is a buffer problem how do you think it should be corrected?

 

Thank you very much MoReese.

 

 

0 Kudos
Message 3 of 11
(3,103 Views)

Actually, I was referring to your function in your almetro.vi;  however, it does look like your are making proper use of the function in the lecto serie.vi.  Your logic looks sound. Turn Highlight Execution on.  It's the light bulb on the tool bar at the top of the block diagram.  With this you can follow the data as it flows through your code.  You can also place probes at any location (i.e. wires, inputs, outputs).  Simply right-click a wire and select probe.  You will see a probe watch window open.  This will contain all the probes that are currently active.  You may also apply the probes while the program is running.  Hover the mouse over any line ant the probe tool will appear.  Left-click to apply the probe.

-----------------------------------------------------------------------------------------
Reese, (former CLAD, future CLD)

Some people call me the Space Cowboy!
Some call me the gangster of love.
Some people call me MoReese!
...I'm right here baby, right here, right here, right here at home
0 Kudos
Message 4 of 11
(3,094 Views)

Hi,

 

In serial communication the time plays the mail role for acquire the data. The time synchronization is more necessary to get the data from the dive.
In your code your while loop is continues running without any delay, may be some time your device not respond that fast. Put some millisecond delay and then see the effect.

Thanks and Regards
Himanshu Goyal | LabVIEW Engineer- Power System Automation
Values that steer us ahead: Passion | Innovation | Ambition | Diligence | Teamwork
It Only gets BETTER!!!
0 Kudos
Message 5 of 11
(3,086 Views)

thank you all guys! I have solved my problem.. it eas in the arrange.vi

 

Best wishes!

0 Kudos
Message 6 of 11
(3,067 Views)

What seemed to be the problem? i have the same one

Thanks

0 Kudos
Message 7 of 11
(3,004 Views)

Unfortunately the OP was not specific on what the issue was.  This is an old thread.  Your particular issue can be caused by a 1000 different things.  Please start a new thread after you have searched the forum for your issue.  When you post, attach the VI in question and we'll have a look.

-----------------------------------------------------------------------------------------
Reese, (former CLAD, future CLD)

Some people call me the Space Cowboy!
Some call me the gangster of love.
Some people call me MoReese!
...I'm right here baby, right here, right here, right here at home
0 Kudos
Message 8 of 11
(2,991 Views)

I know that the topic is very old, but it is worth it to have its solution here. In my case, the reason was the lack of time for a response from the device. I added the appropriate waiting length and the problem was over.

0 Kudos
Message 9 of 11
(907 Views)

Hi spalinowy,

 


@spalinowy wrote:

In my case, the reason was the lack of time for a response from the device. I added the appropriate waiting length and the problem was over.


The "lack of time" most often is not the reason, but the bad/missing implement of the communication protocol!

This excellent video explains how to solve serial communication correctly…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 10 of 11
(901 Views)