Jump to content
OMRON Forums

synchronous assignment in PLC


wfsteele
 Share

Recommended Posts

I tried to use a synchronous assignment in a PLC program, but I couldn't get it to work. Here's what I tried:

 

open plc 2

Ldata.Coord = 2;

P4 = 0;

//P4 == 1;

yy (-0.2);

while (!(Coord[2].DesVelZero && P4)){}

disable plc 2

close

 

What happens when I try to run this (with the sync assignment not commented out) is ... nothing, no errors, no motion. According to the Task Manager, the PLC runs for a hundred usec or so and then stops, but nothing happens. In fact, after running this, I can never again move any axis in CS 2 (with an axis move command, motor jog commands still work) until I reset ($$$) the PPMAC. (Axis move commands in other CSs do still work). If I run this with the sync assignment commented out as shown, then the yy axis moves as commanded and the PLC remains running until I enter the online command P4 = 1, at which time the while loop exits and the PLC terminates.

 

Aside: I initially tried the move command:

yy -.2;

it didn't work and there was no error indication (with the older ide. After installing the just released ide and trying again, there was indication of an error). Although -.2 is a numeric constant which, according to the documentation, is not required to be enclosed in parenthesis, I suspected that the minus sign was causing a problem. So I tried:

yy (-.2);

That didn't work either. Again, with the Sept ide, there was an error indication (but not much of a clue as to the problem). Then I tried:

yy (-0.2);

That did work. It seems to me that all 3 of these should work, at least according to what the documentation says.

Link to comment
Share on other sites

  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Is your coordinate system in incremental mode? Do you want it to be? (When I tried your code, I got a move the first time, then it wouldn't move again, because I was in absolute mode commanding it to the same position.)

 

I'm not getting any problems when I specify the .2 number without the leading zero, either in getting Power PMAC to accept the command or to execute it properly.

Link to comment
Share on other sites

abs/inc is not the issue. I want it to be abs and, for now, I'm relying on that being the default. Anyway, as I said in the original post, if I comment out the synchronous assign, the program works exactly as I expect it to; I just have to manually (with an online command) set P4 to 1 after I notice that the move has completed. Also, as I said, once I have run the program (with the synchronous assign in force) I cannot do an axis move for any axis in CS 2 until I reset the PPMAC. I have 2 motors in the coordinate system, assigned to axes xx and yy. Motor #5 is assigned to xx and motor #6 is assigned to yy. After running the PLC program, if I try an online command like

&2 cx xx 2

or

&2 cx yy -5

nothing happens. (The particular target position I choose doesn't matter; I have tried many different ones). However I can successfully jog motors 5 & 6, e.g.:

#5j^100000

works correctly. It appears, at least in my case, that adding an item to the the synchronous assign queue for CS 2 hangs up the mechanism for doing axis moves in that coordinate system. (Note: other coordinate systems still work OK; for example an online command like:

&1 cx yy 150

works OK.)

What you did in your test and what I am doing appear to be identical, but with different results. So we must actually be doing something differently, but I don't know what that might be.

 

Regarding the numeric constant: You didn't comment on the parenthesis. If indeed they are required for a negative numeric constant, I believe the documentation should clearly state that.

The case of the leading zero is strange. I found that it is possible to get it to work without the leading zero. If, in the editor, I remove the leading zero, I get a list of 11 errors (the editor also displays some squiggly underlines in the program listing to indicate were there are errors). Then, if I click somewhere else in the editor window, the errors go away. I hadn't noticed that before because I had been editing with an external editor. When the file is saved, the ide notices that and asks if it should update itself to use the newly saved file. I click yes and it displays the errors (in the case of no leading zero). So the conclusion is: there is some sort of flakey behavior going on; under some circumstances starting a numeric constant (in this context) with a decimal point will generate (many) errors.

Link to comment
Share on other sites

What is your value of saved setup element Coord[2].SyncOps? This specifies the size of the buffer for these assignments. Could you have set it to 0?

 

I don't need parentheses to use a negative number without a leading zero. I'll have to check into the IDE's error checking, sometimes it is overly sensitive, tagging things that Power PMAC itself does not care about.

 

What IDE version and what Power PMAC firmware version (vers) are you using?

Link to comment
Share on other sites

That is indeed the problem. SyncOps for CS 1 & 2 is zero. I checked for a few others (0, 3, 4); they are 8192. CS 1 & 2 are the two that I am using. I didn't (knowingly) set SyncOps to zero; what might I have done to inadvertently do that? Anyway, I made the correction and now the PLC program works correctly; thanks for your help!

I found that if I leave out the parenthesis:

yy -.2;

the ide shows many errors, but, as you suggest, the PPMAC executes the program correctly. I also discovered that if I omit the trailing semicolon, the errors go away.

I am using ide version 1.4.0.62 and firmware version 1.4.0.27.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share


×
×
  • Create New...