Hello all, I am rather new to using vision as I have mainly used perspective up to this point. However, I am working on vision now and I have ran into an issue.
I have a display whose data is determined by taking two integers, converting them to 8 bit binary numbers, combining the binary numbers to create a 16 bit binary number, then converting that 16 bit binary number to a double value. It is the finale double value which is displayed.
I have done this in perspective by binding the value to an expression structure and then transforming the data using the following script:
num1 = value["key"] | |
---|---|
num2 = value["key_1"] | |
binary1 = format((num1 & 0xFF), '08b') | |
binary2 = format((num2 & 0xFF), '08b') | |
Combined = binary2 + binary1 | |
mBar = int(Combined, 2) | |
PSI = mBar/68.948 | |
return PSI |
Where key is the first tag and key_1 is the second tag.
This works as expected and the correct value is displayed. However, I need to display this exact value in a vision project now. But when I went to go through the same process on the display in vision, I noticed that vision does not have an expression structure option for binding and only an expression option.
Given this, what would be the best course of action to take. I am not sure how I can fit my script all down into the single expression that is required using just the expression option. Is there a way to get in vision a similar binding to the expression structure and transform option that is in perspective?
Thank you in advanced to any help.