Skip to content

Fixed SignedMSWLSW VI for the loggers, Bump LJLogUD and LJStreamUD to v1.22#2

Merged
sjarman28 merged 3 commits intodevelopfrom
bugfix-SignedLSWMSW
Oct 8, 2024
Merged

Fixed SignedMSWLSW VI for the loggers, Bump LJLogUD and LJStreamUD to v1.22#2
sjarman28 merged 3 commits intodevelopfrom
bugfix-SignedLSWMSW

Conversation

@sjarman28
Copy link
Copy Markdown
Contributor

The SignedMSWLSW scaling function was previously returning a U32 representation, but it now returns an I32 representation (signed 32-bit int).

This was previously returning a U32 representation, but it now returns an I32 representation (signed 32-bit int).
@sjarman28
Copy link
Copy Markdown
Contributor Author

The last commit changes the SignedMSWLSW VI to input doubles then cast them as U16. This might look goofy, but it is important to prevent overflow in the I32 representation.

Integers are allowed to overflow in LabVIEW and they don't throw errors when overflow happens. The easiest way to handle overflow is by interpreting the MSW and LSW values as a double then casting as the int representation you want. In LabVIEW it is well defined that a double cast to int will always result in a value within the int representation range. Doubles greater than can be represented with the int are interpreted as the max value (for example, 65535 is the max value of a U16) and doubles smaller than can be represented with the int are interpreted as the min value (for example, 0 for unsigned int representations).

@sjarman28 sjarman28 merged commit 8c1fd43 into develop Oct 8, 2024
@sjarman28 sjarman28 deleted the bugfix-SignedLSWMSW branch October 8, 2024 19:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant