Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you have been placed in read-only mode.
Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).
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:
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:
ioninja-5.3.1
scripts/plugins/Serial/SerialDispatch.jnc
SerialDispatchCode.GetBreak -> SerialDispatchCode.GetBreakCondition and SerialDispatchCode.SetBreak -> SerialDispatchCode.SetBreakCondition
SerialDispatchCode.GetBreak
SerialDispatchCode.GetBreakCondition
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.
Documentation in general needs some serious improvements, that's true Working on that.
In the meantime, we try our best to provide developer-level support and assistance -- here or via the support email.
It seems that in v5.3.2 this should be: g_session.m_breakCondition