07-06-2018 04:04 AM
Hello
I'm acquiring variables via modbus from a slave device.
This device (temperature probe) transmits data in INT16
A temperature of 25.3° C is transmitted via modbus as 253
When I add the NUMERIC INDICATOR in the user interface VI, the displayed value is always without a comma.
I tried to change the view in DISPLAY FORMAT but I can not find the right combination.
What can I do?
I know that you can convert it to FLOATING POINT variable in block diagram, but I would like to simplify the development
Thank
07-06-2018 05:33 AM - edited 07-06-2018 05:34 AM
07-06-2018 06:15 AM
Converting the variable to FLOAT format in block diagram works.
But I would like to avoid working in the block diagram because I have about 100 variables to insert! Thanks
07-06-2018 06:45 AM
Showing the decimal point won't automatically show it at the 'right' place. So it would show 256.0, not 25.6. In other words, I don't think the decimal point does what you think it does.
If you have 100 values like that, manage them in an array (for instance a current value table) and do the division on the array. The code would be exactly the same, no for loop is needed. Let the (your) software do the hard work, that is what it is for.
07-08-2018
01:49 PM
- last edited on
05-05-2025
03:49 PM
by
Content Cleaner
@gigibindi wrote:
Converting the variable to FLOAT format in block diagram works.
Don't over-complicate things. You can leave out the "ToDBL" functions because LabVIEW will coerce the result automatically to DBL. Same difference, less code.
I fact you could create a subVI that does the entire scaling and make it the size of a single ToDBL function. 😄 (If you have LabVIEW 2017 or newer, you could even make it a malleable VI so it can take a scalar or array as needed)
@gigibindi wrote:
But I would like to avoid working in the block diagram because I have about 100 variables to insert! Thanks
If you have 100 such "variables", it means you also have 100 controls and indicators and the complications already start there. As has been mentioned, build the data into 1D- or 2D-arrays as early as possible and use array indicators and divide the array by 10. If it is just for display, format it all into a single table indicator. You can even add the data names into the table header.