| View previous topic :: View next topic |
| Author |
Message |
univer Junior

Joined: 20 Dec 2013 Posts: 3
|
Posted: 16/06/2014 11:47 Post subject: Timer problems in TIA V13 |
|
|
Hello
I have a problem using function I made in TIA v12 inside TIA v13.
In v12 I created a simple SCL function named SetTimeTP which looks like this:
[url=http://oi61.tinypic.com/10x9e6w.jpg]v12 Function[/url]
and a data block from where to chose timer when function is called:
[url=http://oi58.tinypic.com/spaf0g.jpg]v12 DB[/url]
With that I could easily set and test timer:
| Code: | //Set time
"SetTimeTP"(tNo := "Tmr".TMR_1, IntervalT := #delay);
//Test timer status
"Tmr".TMR_1.Q
|
Now in v13 this is not acceptable, I can create everything the same but I get this error inside SetTimeTP function:
[url=http://oi61.tinypic.com/2n1rvx3.jpg]v13 Function[/url]
Everything seems to be OK, it accepts #tNo of type TP_TIME as input, but it looks like the syntax should be different even though it accepts it as I write it, but when I make a semicolon it marks it as error.
If anyone has any ideas of how to make it work please help.
I can use timers normally, but this functions seemed convenient and all the different timers could be stored in one data block.
I am not sure where to put this topic so I apologize if it's not in the right sub forum.
Last edited by univer on 22/06/2014 10:22; edited 1 time in total |
|
| Back to top |
|
 |
univer Junior

Joined: 20 Dec 2013 Posts: 3
|
Posted: 21/06/2014 20:36 Post subject: |
|
|
I've been playing a little with this today and I found a solution, it's ridiculously simple.
Admin/moderator can now delete this topic if he wants to. |
|
| Back to top |
|
 |
duckman Member

Joined: 08 Jul 2013 Posts: 214
|
Posted: 22/06/2014 01:29 Post subject: |
|
|
| Please show your solution this problem |
|
| Back to top |
|
 |
univer Junior

Joined: 20 Dec 2013 Posts: 3
|
Posted: 22/06/2014 09:34 Post subject: |
|
|
You just have to move #tNo (data type TP_TIME) from Inputs to InOut inside the function.
...
Last edited by univer on 21/02/2015 18:37; edited 1 time in total |
|
| Back to top |
|
 |
duckman Member

Joined: 08 Jul 2013 Posts: 214
|
Posted: 22/06/2014 10:22 Post subject: |
|
|
| Thank you for passing on your experience. |
|
| Back to top |
|
 |
|