LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

ASCII number decimal point display issue

Solved!
Go to solution

Having a weird problem with a Plug-n-Play driver for the Keysight/Agilent/HP 8510C.    There is a VI driver (attached) called "Output Active Marker.vi"

 

The problem I'm having with this VI is that it works perfect when my marker value is between 9.9999 and -9.9999.    

 

When the marker value goes between 99.999 to 10.000 or -10.000 and -99.999....the VI does not shift the decimal place on the DBL Indicator.   For example:   a marker reading of -15.347 would display -1.534

 

Also, when a reading above 100 or below -100 is dicplayed, it has the same issue with the decimal point.       Example:  -104.56 reads  -1.04

 

I pulled-up the Agilent Key word Dictionary for this function (located here:   http://www.keysight.com/upload/cmc_upload/All/08510-90280_8510KeyWords.pdf ) and it states that the output is an ASCII string, not a DBL number. (page 515 & 516)

 

I tried taking the base VISA Read and Write functions and output directly to the Read string output....but it has the same problem.

 

So, It looks like this VISA Read function is not playing nice with the 8510C.....does anyone have an idea of how to "fix" it?

0 Kudos
Message 1 of 8
(4,369 Views)

@SparkyOne wrote:

Having a weird problem with a Plug-n-Play driver for the Keysight/Agilent/HP 8510C.    There is a VI driver (attached) called "Output Active Marker.vi"

 

The problem I'm having with this VI is that it works perfect when my marker value is between 9.9999 and -9.9999.    

 

When the marker value goes between 99.999 to 10.000 or -10.000 and -99.999....the VI does not shift the decimal place on the DBL Indicator.   For example:   a marker reading of -15.347 would display -1.534

 

Also, when a reading above 100 or below -100 is dicplayed, it has the same issue with the decimal point.       Example:  -104.56 reads  -1.04

 

I pulled-up the Agilent Key word Dictionary for this function (located here:   http://www.keysight.com/upload/cmc_upload/All/08510-90280_8510KeyWords.pdf ) and it states that the output is an ASCII string, not a DBL number. (page 515 & 516)

 

I tried taking the base VISA Read and Write functions and output directly to the Read string output....but it has the same problem.

 

So, It looks like this VISA Read function is not playing nice with the 8510C.....does anyone have an idea of how to "fix" it?


I think it (or you) are not parsing the entire output?  It looks as if it is trying to output as an engineering string and is missing the exponent part?

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.
Message 2 of 8
(4,350 Views)

Please modify yourt VI so it also display the actual received string (right-click string right after the read function...create indicator).

Once you get a result that seems wrong, right click the string terminal and "Create constant". Now save and attach the VI once more.

 

It also seems a bit unusual to wire the return count to the byte count. I what universe does the number of bytes written (9 in this case) have anything to do with the number of bytes to read? You are reading only 9 characters, so depending on how the number is formatted, you might clip the exponenet part, for example. Do you know if the response contains a termination character?

 

Maybe you also just need a small delay between writing and reading.

Message 3 of 8
(4,325 Views)

Guys, I apperciate that you think this is my handiwork, but it's just part of this driver set.    I really have no clue who wrote it, or what intents were behind the methodology.

 

LabView 2014 - 8510C Plug-n-Play driver

 

The formatting is detailed in the documentation in my first post, but here it is again:

Page515.JPG

I am trying to read the Marker A output.   Marker B is nothing according to the next page:

Capture.JPG

 

I'll play around with the OUTPMARK command in NI MAX when I get back on the machine Monday.    That should tell me what is actually coming out of the machine.   I was thinking about it on my way home, and I think you're correct....    This Driver is probably truncating the Engineering notation in the response.

 

Does anyone know what this string command is supposed to do? 

Capture.JPG

 

altenbach, is this kinda what you were thinking (see attached VI)?

 

 

0 Kudos
Message 4 of 8
(4,299 Views)

Let's try this again....   It's amazing what you learn when you have time to read:

Capture.JPG

Capture.JPG

 

Looks like the total response is 50 bytes....so yea, it is likely getting truncated.    Is there a function that can capture that engineering notation?   Attached a new VI with some tweaks.....can't try it until Monday.

0 Kudos
Message 5 of 8
(4,286 Views)

First, parse the two numbers out, then you can use Fract/Exp String To Number Function on each of them to convert them into numbers.

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.
Message 6 of 8
(4,270 Views)
Solution
Accepted by topic author SparkyOne

Thanks for your help guys.    All I needed to do was remove the Write-Read byte wire, then wire a constant 49 to the input byte count to the Read function.   Works perfect with no further conversions required.

 

Does anyone know who the Author of that Plug-n-Play driver is?   That function should probably be updated with these changes.

0 Kudos
Message 7 of 8
(4,219 Views)

Thanks for confirming that I was right about that wire. It is possible that it was an autowire accident, because there is no conceivable reason to wire those together.

 

There is nothing useful in the VI revision history or documentation. Where did you get the driver package?

0 Kudos
Message 8 of 8
(4,193 Views)