tidy structured look

interd0g

Member
Join Date
Jun 2008
Location
FALMOUTH
Posts
14
I recently started playing wiht a Toshiba T1 to run a renwable power house. It has a solar array, generator and can hook to the utility when they are on.
Depending on the source some loads are allowable and some not, and connection to the utility is minimised. Seemleess power is required to safeguard the house elcronics stuff.
The t1 also does a perimeter alarm and auto yard lights in its spare time.

Here is my problem;-

Once some process is under way, with timers and counters ticking away, the process may terminate in various ways ( eg manual buttons, power failure or the process times out)
When it does it will catch some timers and counters in mid- flight with some value remaining in the register.
Before the next instance of this process they need to be back to some ok initial values.

Right now, I figured this by trial and error and put 'MOV' instructions here and there to re-initialise these timer/counter registers for each input or outcome which could start or end the process.
It reached the point of inscrutable and un t-shootable ( but it DOES work for the moment.)
There most be a more elegant way of thinking and doing this?
 
I have zero experience with the Toshiba PLCs, but I had a quick look at the manual:

"It is possible to specify the T registers as retentive to retain their data in the event of a power failure."

It sounds like you have yours set to be retentive, so they retain their current value through a power cycle. I think if you set them to be non-retentive, they will automatically reset back to zero.

:bberhcug:

-Eric
 

Similar Topics

Hi, I'm doing a compare in s7 stl. The code i have written works fine but looks messy. What I'm trying to achieve is to set m9.0 when the PLC...
Replies
15
Views
3,786
I´ve being trying wrap head around FOR loops.. When and what can this be used for? I´ve mostly seen it move data, resettting arrays etc. I made a...
Replies
13
Views
350
Hi! When is CASE preffered? CASE uses a numreric variable for the cases and doesnt handle BOOL, but this can be done with numreric and bool using...
Replies
4
Views
169
Hello, doing switch from FBD to ST. First task is converting my old work. How do you sum variables? For example, Interlock1, interlocl2 and...
Replies
5
Views
216
Hello, I am using studio 5000 pro and am trying to figure out the structured text. Here's my scenario: An operator scans a barcode, the barcode...
Replies
15
Views
383
Back
Top Bottom