kevinharris Posted July 16, 2018 Share Posted July 16, 2018 I have the code below in a PPMAC script file. It is reporting "syntax error, unexpected SHIFT-LEFT" on the first line that has the <<. The following lines do not report the error. If I comment out the first shift left line, then the next shift line reports the same error. The editor shows the first << as underlined in red showing the error. According to the PPMAC software reference manual, this command should be allowed. Any ideas on what I'm missing here? // Write flag data to Modbus temp_byte = rRange200y; temp_byte << 1; temp_byte |= rRange200x; temp_byte << 1; temp_byte |= rRange100z; temp_byte << 1; temp_byte |= rRange100y; temp_byte << 1; temp_byte |= rRange100x; temp_byte << 1; temp_byte |= rESTOP_Out; temp_byte << 2; Sys.ModbusServerBuffer[2] = temp_byte; //load byte Link to comment Share on other sites More sharing options...
zros Posted July 16, 2018 Share Posted July 16, 2018 Without checking I am guessing that it is complaining that you have not assigned the left-shifted value to anything. Maybe temp_byte = rRange200y; newtemp = temp_byte <<; ... I have the code below in a PPMAC script file. It is reporting "syntax error, unexpected SHIFT-LEFT" on the first line that has the <<. The following lines do not report the error. If I comment out the first shift left line, then the next shift line reports the same error. The editor shows the first << as underlined in red showing the error. According to the PPMAC software reference manual, this command should be allowed. Any ideas on what I'm missing here? // Write flag data to Modbus temp_byte = rRange200y; temp_byte << 1; temp_byte |= rRange200x; temp_byte << 1; temp_byte |= rRange100z; temp_byte << 1; temp_byte |= rRange100y; temp_byte << 1; temp_byte |= rRange100x; temp_byte << 1; temp_byte |= rESTOP_Out; temp_byte << 2; Sys.ModbusServerBuffer[2] = temp_byte; //load byte Link to comment Share on other sites More sharing options...
kevinharris Posted July 16, 2018 Author Share Posted July 16, 2018 Figured the problem out with the syntax error. should have been: temp_byte <<= 1; Link to comment Share on other sites More sharing options...
Recommended Posts