useful primitives

For general discussion related FlowStone
Post Reply
fixstuff555
Posts: 151
Joined: Thu Oct 21, 2010 3:24 pm

useful primitives

Post 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
Embedded
Posts: 143
Joined: Sat Oct 30, 2010 1:42 pm

Re: useful primitives

Post by Embedded »

Could be useful, but most times these are enough:

Decimal - Hex - Binary - Hex - Decimal
Attachments
Dec_Hex_Bin_Hex_Dec.fsm
Number Conversions
(286 Bytes) Downloaded 1574 times
fixstuff555
Posts: 151
Joined: Thu Oct 21, 2010 3:24 pm

Re: useful primitives

Post 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 1728 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.
glenbot98
Posts: 3
Joined: Mon Sep 06, 2010 7:43 pm

Re: useful primitives

Post by glenbot98 »

This is great, thank you.
Embedded
Posts: 143
Joined: Sat Oct 30, 2010 1:42 pm

Re: useful primitives

Post by Embedded »

There are 10 types of people in this world, those that understand binary and those that don't! :)
Post Reply