06-04-2015 07:35 AM
Hi folks, I’d like to pass something like a BCD to another PLC over a serial link to represent discrete alerts of up to 16 other systems to indicate they are operational at any given time. My first thought was to use a 4-bit code to and adopt an enumerated type approach. where if 0 was sent then system 1 was operational, or if 15 was sent then system 15 was operational etc. But it is entirely possible that multiple could be operational concurrently and so not sure where to go from here. The link is probably going to be OPC based
Anyone got any ideas on how to send multiple discrete alerts without having a separate channel for each of them? In reality I will have over 250 systems but for simplify I have made the example 16
Thanks
06-04-2015 07:41 AM
I would not use Binary Coded Decimal here. Instead, I would just give each system a bit. You can then tell which ones are operational by searching for all of the TRUE values.
06-04-2015 07:46 AM
Ye considered that, but that would require +250 bits. Ideally id like one channel; maybe it cant be done what I have in my head, i.e. BCD.
06-04-2015 08:00 AM
If it was just one can run at a time, then I would just use a single byte (1 value per system). It is the concurrency that pretty much demands seperate bits.
06-04-2015 08:05 AM
You can't. If you have 250+ systems and want to have a bit be the indicator of good or bad, then you are going to need 256 bits, or 8 bytes.
You said you are using a serial link. Just define a serial protocol that lets you transmit that data. BDC is not meant for what you want, but to transmit decimal digits in a binary format. http://en.wikipedia.org/wiki/Binary-coded_decimal
06-04-2015 08:07 AM
ye, exactly my thoughts!
still, 76 chars are better than 250 surley!! BCD would still work, maybe a better appoach mind you .
06-04-2015 08:15 AM
labnoob wrote:
still, 76 chars are better than 250 surley!! BCD would still work, maybe a better appoach mind you .
Where are you getting 250 characters? What RavensFan and I are suggesting is 8 bytes/characters. Use the bits!
06-04-2015 08:22 AM
06-04-2015 08:33 AM
I miscalculated. Yes it would be 32 bytes/characters time 8 bits per byte to get 256 boolean bits. 32 bytes is still better than some other choices. But you'd still, have to establish a protocol to make sure the 32 bytes you read are in the correct order. (A partial read would throw off the boundaries of your packet of data.)
06-04-2015 08:36 AM