12-05-2009 11:15 PM
I'm trying to typecast a fixed point value into a string as part of my code on a cRIO, and it's actually not working correctly.
It works correctly on my laptop, but when I run it on the cRIO, it converts it into empty data of the same size.
The string is part of the typedef I'm using for data transmission in a CAN emulation. The reason it's not the fixed point in the first place is because it must hold different datatypes in different situations. Thinking to keep it as similar to the actual CAN as possible, I chose string over variant because, in CAN, messages are transmitted as a byte array.
Anyways, I've tried two different methods of converting it to and from a string, and they both end with the result of the constant wired to the "data type" terminal. (I named my cRIO "NeverWireLive")
So it looks like I may have to switch to using variants. However, I'm still going to have to find a way around this problem for the actual CAN software. The CAN spec for our motor controllers uses fixed point numbers in many cases.
I've attached images of what my example, but I figured it was simple enough that having the original VI wouldn't be of much use.
12-07-2009 02:42 PM
12-07-2009 06:11 PM
Yes, type-casting integers and floats works fine.
In my example I forgot to check the datatype on the constants, so the "flatten to string" wasn't working either.
However, I corrected the datatype.
So it's just the type cast that isn't working.
What is the difference between those two functions?
12-08-2009 03:23 PM