structured-text

Converting 32-Bit Real to 2x 16-Bit Bytes

不打扰是莪最后的温柔 提交于 2019-12-11 19:33:09
问题 I'm trying to send a 32-Bit Real across a CAN communications (IFM) but the CAN comms only accepts a 16-Bit value. If the value I'm trying to send goes above 255, it resets back to 0 and continues in that pattern. I therefore need to split the 32-Bit Real value in to two 16-Bit values and then reassemble on the other side of the comms. I just can't seem to get my head around how to do it in structured text. Any help would be appreciated 回答1: I know I am a little late to the party but wanted to

Is there a way to print to output console? (twincat3)

冷暖自知 提交于 2019-12-11 14:58:32
问题 Is there a way to print to output to console like debug.print() in VB.NET using structured text? (twincat3) 回答1: You can send messages through ADS commands from TwinCAT code. The function is called ADSLOGSTR. There also also own functions for DINT and REAL, but the STRING function of course can be used with anything. The function has three inputs: msgCtrlMask Mask that describes the message type Types can be found here For example, to show warning message and save it to Windows log: