LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to convert long hex string to individual decimal values..??

Solved!
Go to solution

@Tusharvp4 wrote:

Error-1073807253 (Hex 0xBFFF006B) A framing error occurred during transfer...


That normally points to an incorrect setting on your serial port (baud rate, number of bytes, number of start or stop bytes, handshaking, etc.).  It could also be from getting extremely unlucky and you initialized your port when a message was going out and what was actually data was interpreted at a start bit, which can cause all kinds of errors.  This is at the UART level.  If you want to be really sure, you could use a FOR loop before everything to try to read a byte until this error does not occur.  I say FOR loop so you can limit the attempts.  I have seen this when dealing with an instrument that just constantly sent out data and I had to jump through some weird hoops to get it to sync up right.  But you do have a gap between whole messages that the UART will use to sync up at the bit level.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 31 of 39
(731 Views)

In this case...If i use little time delay and flash buffer between configure port & read serial loop..

 

is it good to use or not..??

0 Kudos
Message 32 of 39
(722 Views)

@Tusharvp4 wrote:

In this case...If i use little time delay and flash buffer between configure port & read serial loop..

 

is it good to use or not..??


You will still have the race condition.  Again, we are talking about at the UART level.  The buffer is after the UART found data.  So flushing will do nothing.  But I got thinking about this and came to the conclusion that you could just simply not stop your loop on an error.  Then you, as a user, can just ignore the error until it syncs up and goes along its merry way.  So if you are using my example, remove the OR and have only the Stop button wired up to the stop conditional terminal.  In theory, it should sync up when the next message comes around (ie during the gap between messages).


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 33 of 39
(708 Views)

@crossrulz wrote:

@Tusharvp4 wrote:

In this case...If i use little time delay and flash buffer between configure port & read serial loop..

 

is it good to use or not..??


You will still have the race condition.  Again, we are talking about at the UART level.  The buffer is after the UART found data.  So flushing will do nothing.  But I got thinking about this and came to the conclusion that you could just simply not stop your loop on an error.  Then you, as a user, can just ignore the error until it syncs up and goes along its merry way.  So if you are using my example, remove the OR and have only the Stop button wired up to the stop conditional terminal.  In theory, it should sync up when the next message comes around (ie during the gap between messages).


I've done this before.  Additionally, I grab the VISA timeout value just before the loop.  Then I start a timer inside the loop.  If the timer >= the timeout value and I haven't sync'd up, I manually throw a VISA timeout error and force an exit.  That way you can fake a timeout, even though you are actually constantly resetting the timeout flag.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 34 of 39
(681 Views)

@Gerdw..

Can you please verify both case structures.I did something wrong from yours posted image....!! 

 

@crosseulz..

I am using older version of labview than yours..I need conversion value VI image..

 

I created fake timeout with flush buffer..It is working & i am not losing any data in 0.25 second..

 

But causing problem..Ones removing USB  from instrument..It is not able to reconnect until I stop VI...

 

 

 

0 Kudos
Message 35 of 39
(656 Views)

Hi Tusharvp,

 


@Tusharvp4 wrote:

Can you please verify both case structures.I did something wrong from yours posted image....!! 


Why do you OR with a TRUE before the stop condition of the while loop? I used a stop button…

Why do you use InsertIntoArray? I didn't use this function…

Why is the conversion still so crowded?

Why don't you read the parameter number from the received message? Why don't you use it to replace the corresponding element in the array holding all parameter values (as shown in my image)?

Why don't you show the display style indicator at the string constant? It always helps to document your code when "non standard" display modes are recognizable right from the beginning!

What's the point of this sequence frame? Does it serve any purpose?

Why do you need to use so many constants to call SerialPortInit? You don't need to wire/set default values of that function!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 36 of 39
(644 Views)

Oh.....!!!

 

I was doing mistake..using CONSTANT TRUE instead of BOOLEAN STOP CONTROL for running while loop of serial read..

 

I am truly & humbly apologizing to both guys @Gerwd and @crossrulz...Yours both VIs are running absolutely absolutely fine...Not losing any data at any speed..

 

Many thanks for helps...Respect...!!!

 

 

 

 

0 Kudos
Message 37 of 39
(621 Views)

@Crossrulz..

 

Can you please convert yours posted code in Labview 17.0..??

0 Kudos
Message 38 of 39
(559 Views)
Solution
Accepted by topic author Tusharvp4

@Tusharvp4 wrote:

@Crossrulz..

Can you please convert yours posted code in Labview 17.0..??


Here you go.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 39 of 39
(531 Views)