Hello,
In a serial session, I'd like to Set BREAK: on for a specific duration with a jancy script. Is this possible? I can toggle manually by clicking the purple BRK button.
Thanks,
Stuart
Hello,
In a serial session, I'd like to Set BREAK: on for a specific duration with a jancy script. Is this possible? I can toggle manually by clicking the purple BRK button.
Thanks,
Stuart
Yes, it's possible; you can control all parameters of a serial port (including the break condition) from your script via the "dispatch" object g_session
:
void main() {
connect();
// configure the port
g_session.m_baudRate = 38400;
g_session.m_dataBits = 8;
// ...
for (;;) {
g_session.m_break = !g_session.m_break; // toggle break condition
sys.sleep(1000);
}
}
Note: there's a typo in the serial dispatch script in the latest official release ioninja-5.3.1
(will be fixed in the very next service release). In the meantime, for the script above to work, please open to scripts/plugins/Serial/SerialDispatch.jnc
and replace:
SerialDispatchCode.GetBreak
-> SerialDispatchCode.GetBreakCondition
and
SerialDispatchCode.SetBreak
-> SerialDispatchCode.SetBreakCondition
Let me know if this works for you.
Hi Vladimir,
Thank you, that worked well.
I feel like I should have been able to search for that in the IONinja documentation. Keywords "session" and "break" both don't yield relevant information for me.
Thanks,
Stuart