Sign in to follow this  
Followers 0
lgbnaft

NJ Move statement versus Inline ST

6 posts in this topic

Problem:   In line move statements in a sequencer do not get data moved before getting to next step.

The attached picture of code shows the sequence steps in question, and the code would stop at sequence step 7 

even though an INT#1 should be in the pass variable when the CAB3_NI_1_04 was equal to 1.

 

Question:  Is the execution time of an In-line ST faster than using move statements?

I figured the Move statement was in the middle of trying to move the INT#1 and the sequencer got past

the Move before a completed action. 

I wondered if structured text is the answer or am I looking at this wrong.

 

 

Move_sample.bmp

Share this post


Link to post
Share on other sites

Can you show the code that turns on the bits in the sequencer?  My guess is that you are inadvertently turning on bit 7 immediately after turning on bit 6, so the first rung is never executed, or you turn on bit 7 before CAB3_NI_1_04 = 1.  If you post the code in its entirety, we could investigate easier.... 

Share this post


Link to post
Share on other sites

The sample code does not stop at sequence 7 in simulation.  Once in Step 6 and CAB3_N1_1_04 becomes 1, it moves straight through to step 8.  So, I am guessing that some other part of your code (that was not included in the sample code) is changing ST8_SB_Stage1_Pass to something besides 1.  Not sure if it is when the step 6 bit turns on and then ST8_SB_Stage1_Pass is changed after the rung in the picture, or if it is when bit 7 turns on and  ST8_SB_Stage1_Pass is changed before the rung in the picture.  

Share this post


Link to post
Share on other sites

I agree that in simulation the code stops at Step 8, but in the NJ-501 processor I had issues with the program stopping at Step 7

and ST8_SB_Stage1_Pass would not move a 1 during Step 6

The current code only "resets" ST8_SB_Stage1_Pass at Step 1 by moving a zero, sorry, I accidentally omitted this in the sample.

I am actually curious if the PLC was bogged down and the memory area for the variable was simply not written to during the sequencer.

I had to increase the periodic task to 2ms due to some overhead issues and non management of priorities on my part.

Back to my original question:

Question:  Is the execution time of an In-line ST faster than using move statements?  (or better said execution time of move statements?)

 

Share this post


Link to post
Share on other sites
7 hours ago, lgbnaft said:

Question:  Is the execution time of an In-line ST faster than using move statements?  (or better said execution time of move statements?)

I would be very surprised if the execution time for both were not the same, but have not found anything saying as much.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0