Posted 9 Oct 2016 Hello all I m new in st programming in omron I want to use timer in st please help me regarding this Share this post Link to post Share on other sites
Posted 9 Oct 2016 If you look at the help file for a function / instruction that you would like to use, you can see the ST layout for that item. See below: Just copy that text and paste it into your structured text and modify. You could end up with something like this: Variables: 1 person likes this Share this post Link to post Share on other sites
Posted 10 Oct 2016 I just noticed that I gave you an answer for Sysmac Studio. Please ignore the above answer.... For CX-Programmer, type ahead works in the structured text environment. The type ahead will show you what each field is expecting: So, you end up with something like this: 1 person likes this Share this post Link to post Share on other sites
Posted 25 Sep 2018 On 9/10/2016 at 10:07 PM, Michael Walsh said: If you look at the help file for a function / instruction that you would like to use, you can see the ST layout for that item. See below: Just copy that text and paste it into your structured text and modify. You could end up with something like this: Variables: May you help me change this ladder into ST, please Share this post Link to post Share on other sites
Posted 25 Sep 2018 Make sure to declare all of the variables that you are using in the structured text block as I have shown above. I declared I00 as a global since your code did that. 1 person likes this Share this post Link to post Share on other sites
Posted 25 Sep 2018 34 minutes ago, Michael Walsh said: Make sure to declare all of the variables that you are using in the structured text block as I have shown above. I declared I00 as a global since your code did that. Thank you so much Wash. When I want to use another TON with different PT , do I need to declare another function block with different instance name or can I use that FB above , only need to change the value of T , and the condition of IN Share this post Link to post Share on other sites
Posted 25 Sep 2018 41 minutes ago, vanquangtk said: Thank you so much Wash. When I want to use another TON with different PT , do I need to declare another function block with different instance name or can I use that FB above , only need to change the value of T , and the condition of IN You would need to declare another instance of the FB. You could use the TIMER function however. Functions do not require instances. 1 person likes this Share this post Link to post Share on other sites
Posted 25 Sep 2018 21 minutes ago, Michael Walsh said: You would need to declare another instance of the FB. You could use the TIMER function however. Functions do not require instances. Thank you Walsh again. By the way, this problem is not related to the topic; but do you know how to clear an event in event history. Share this post Link to post Share on other sites
Posted 22 Apr 2019 Hi Michael Walsh, I had a question about using timers or counters in structured text. I did declare the timer in the external section. I did try it declaring it in internal. I always end up getting the same error. I suppose you will be able to help me with my question. Please see the attached screenshot of my program and errors. code :TIMX(A, TimerNumber, 500); Declaration:TimerNumber TIMER INTERNAL 0 0 ERROR: Symbol 'TimerNumber' is the invalid data type(TIMER or COUNTER) in the SFC/ST program. Thanks JOEL Share this post Link to post Share on other sites
Posted 22 Apr 2019 I am not having any issues. If you post your code here(.cxp file), I can look at it to see if I can tell what is wrong. Share this post Link to post Share on other sites
Posted 22 Apr 2019 (edited) 10 hours ago, joelsimon15 said: Hi Michael Walsh, I had a question about using timers or counters in structured text. I did declare the timer in the external section. I did try it declaring it in internal. I always end up getting the same error. I suppose you will be able to help me with my question. Please see the attached screenshot of my program and errors. code :TIMX(A, TimerNumber, 500); Declaration:TimerNumber TIMER INTERNAL 0 0 ERROR: Symbol 'TimerNumber' is the invalid data type(TIMER or COUNTER) in the SFC/ST program. Thanks JOEL What is the model number of the PLC you are using? CJ2M, CP1L, CP1E............................ Structured Text timers or Counters can ONLY be used with CS/CJ series CPU units version 4.0 or later, or with CJ2-Series CPU units. Edited 22 Apr 2019 by BITS N BYTES More Info Share this post Link to post Share on other sites
Posted 22 Apr 2019 26 minutes ago, BITS N BYTES said: What is the model number of the PLC you are using? CJ2M, CP1L, CP1E............................ Good point.... @BITS N BYTES Share this post Link to post Share on other sites
Posted 27 May 2022 I wanted to point out some misleading info / mistakes in my comments above. The first bit in the TIMX structured text instruction is the enable bit (highlighted yellow). To access the done bit, you need to look at the TimerNumber.CF flag (Complete Flag - Highlighted green) and to access the present value of the timer, you would use the TimerNumber.PV (Present Value - Highlighted blue) UINT variable. See my example below. Share this post Link to post Share on other sites