Jump to content
OMRON Forums

MacroSlaveSAVE complete / misleading cmd error


daves
 Share

Recommended Posts

I am using the recommended approach:

 

Ldata.CmdStatus = 1;
cmd "whatever"
sendallcmds; 
while (Ldata.CmdStatus > 0) {} 
if (Ldata.CmdStatus < 0)
{
	send 1 "1:  error %d", Ldata.CmdStatus;
}

 

I have a PLC which is like:

 

call SetupMACRO();
call DefineStuff1();
call DefineStuff2();
call DefineStuff3();

 

The first sub program sets up the macro. The others do some ptr assignment all using cmd as outlined above.

 

I was getting an error -50 (which I found was MACRO COM TIMEOUT from another post here) in DefineStuff2. If I commented out DefineStuff2 it would appear in DefineStuff3. Neither of these talked to MACRO. It was more confusing in my real code but I managed to track it down to a bit in SetupMACRO where I had:

 

...
cmd "MacroSlaveSAVE32";
sendallcmds;

// Start plccs
cmd "MacroSlave32, I15=1";
...

 

It appears the call to MacroSlave32 is being attempted too soon after the save (does this sound correct?).

 

Is it possible to know when the save has finished or do I have to pause 1s?

 

Why does the error return at a later time than the recommended code to trap errors? If this is the nature of the ASCII buffers it makes it rather unusable. Can it be fixed? Can cmd not return until a response is received (success or error)?

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Guest
This topic is now closed to further replies.
 Share


×
×
  • Create New...