Jump to content
OMRON Forums

bit shift left error


kevinharris
 Share

Recommended Posts

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

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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

Guest
This topic is now closed to further replies.
 Share


×
×
  • Create New...