Hi,
I use a Loxone RS232 extension to send to Velleman K8056 8-relay boards. The RS232 actuators in Loxone config work perfectly fine. That is, if you use only only one of the 32 actuators at a same time (4 boards x 8 relays per board). As I want to use them for opening/closing up to 5 blinds, only 1 of the 5 corresponding RS232 command strings gets through to the boards, or none at all.
So I thought of using a PicoC program block, to send a string of 4 bytes to update all 4 boards at once.
// 2015-12-30 this PicoC program block writes via RS232 to Velleman K8056 RelayCards
// This test should show ABCD on the RS232 sniffer ....
STREAM* pRs232Stream = stream_create("/dev/tty/RS232",0,0); // create rs232 stream to the name of the Loxone RS232 extension, which I named "RS232"
char* pRS232Cmd = "ABCD";
while(TRUE)
{
if (pRs232Stream != NULL)
{
setoutputtext(0, pRS232Cmd); // this shows "ABCD" in Loxone Liveview
stream_write( pRs232Stream, pRS232Cmd, strlen( pRS232Cmd )); // write to output buffer
stream_flush(pRs232Stream);
printf("%s", pRS232Cmd ); // shows "ABCD" in Loxone Log window
setoutput(0,1) ; // set AQ1 to show activity
sleep(1000);
setoutput(0,0) ; // reset AQ1 to show activity
sleep(1000);
}
}
}
stream_close(pRs232Stream);