Skip to main content

Changing parameter types (casting)

Data Flows support various types of values such as integers, floating point values, and byte arrays. Often these parameters are predetermined as 64 bit (e.g., evaluated values) and you may desire to shrink them down for use in an outgoing packet.

Type

Let’s examine 3 parameters created in a data flow.

partial data flow

The evaluator outputs a single constant value of 123.456 while the decommutator uses a simple map extracting a 32 and 64 bit floating point value.

map floats

All of these parameters will move through the data flow as 64 bit values.

Commutating

Let’s assume we know that 32 bits are acceptable for the values (both the extracted 32 and 64 bit) and we want to pack these up into a packet to send out (commutate them) and not waste space, or perhaps we need to make the packet fit a predetermined design for the downstream consumer. Let’s look at the commutation step.

commutator

The commutator uses a map to define and lay out the packet format. It’s in this map where we can redefine (or “reformat”) these parameters to be the length (bit size) we desire.

map floats 2

The values will be cast from one type to the other, so if a floating point value is larger than the 32 bits, you will have overflow and undesirable results.

Integers

You can also reformat integer values. Extracted integers also move through the data flow as 64 bit values, but integers can be reformatted/cast to whatever size you desire. For instance,

map floats and integers