Page 1 of 1

useful primitives

Posted: Sat May 14, 2011 10:30 pm
by fixstuff555
HI all,

Here are some useful primitives that may be useful. These should be built into Flowstone IMO, but here they are anyways.

1) 16 bits to an int

2) int to 16 bits

Both can be broken down or combined into different sizes obviously. These will be useful in conjunction with Embedded's Modbus modules as well, since they deal with integer I/O.

Enjoy!

bool_pack_unpack.fsm
(1.71 KiB) Downloaded 1648 times

Re: useful primitives

Posted: Sat May 14, 2011 11:24 pm
by Embedded
Could be useful, but most times these are enough:

Decimal - Hex - Binary - Hex - Decimal

Re: useful primitives

Posted: Sun May 15, 2011 12:04 am
by fixstuff555
I knew about those, but there aren't primitives to break out individual bits... I guess you could do it that way using this way:

another_way.fsm
(551 Bytes) Downloaded 1729 times


But that just seemed odd to me. I come from the PLC industrial world as such, and I have always like having a block that I could tie an output to a particular bit without thinking too much about it.

Re: useful primitives

Posted: Sun May 15, 2011 12:19 pm
by glenbot98
This is great, thank you.

Re: useful primitives

Posted: Sun May 15, 2011 5:32 pm
by Embedded
There are 10 types of people in this world, those that understand binary and those that don't! :)