STL Help again!!

STL??? said:
The original programmer mapped ASI Master 1 sensors to M140.0 to M159.7 then called the sequence program for the first station.
He then Mapped ASI Master 2 sensors to the same M addresses and then called the (copied) sequence program as station 2.
How he mapped it? In any case it's a bad programming style. Too complicated in debugging. Yes, it'l be better for you to map Master 2 into another place.
 
Simon,
The way the code works is that if a sensor is evaluated and the condition not met, It conditionally jumps to a label where a FC generates a protool textlist value.

So there is only one pointer value worked on each call of the sequencer.
The problem is there is a sensor number on the display for diagnostics, But no actual error message to Log which sensor was defective.

The operators currently are having a field day with this logging downtime as sensor faults!!

We need traceability.

I hope i can do it with 1 timer per FC Call, I prefer not to go down the IEC route.

Something along these lines

1. analyse the pointer
2. Identify the textlist no
3. Get the sensor address indirectly based on the Textlist value
4. Evaluate its condition
5. If not OK - start fault evaluation time
6. If Timeout
7. Set Error text for Indirect sensor ~ indirectly to correct Message bit :ROFLMAO:

Ill see how i get on!!

STL
 
Hm, pointers is one thing, timer is another. What does it mean "each call of the sequencer"? How often it occurs? Every OB scan or not? Main question: how pointer in AR1 points to concrete sensor, how it points to another after this? Now I don't understand this.
For example, if in scan 1 pointer points to sensor1, in scan 2 to sensor2 - timer will not work properly because it's called with different sensors.
 
OK,

The Step controller for each Station is broke down into individual
sequences:

For example - Part control

The code is as follows:
 

AN "Part Control"
JC M042
LAR1 P#M 146.4
A "ST1".SENSOR._8S5
JCN M004
LAR1 P#M 146.5
A "ST1".SENSOR._8S6
JCN M004
LAR1 P#M 146.6
A "ST1".SENSOR._8S7
JCN M004
LAR1 P#M 146.7
A "ST1".SENSOR._8S8
JCN M004
AN "TRANS-ENDE"
= "TRANS-ENDE"
M042: NOP 0



Part Control is set active by the sequencer,If part control isnt active, the sensor evaluation doesnt take place.

When part control is active each one of the above sensors must be ok to achieve "TRANS-ENDE" which tells the sequencer to write the next step which is in this case Clamp Parts.

Example
LAR1 P#M 146.4
A "ST1".SENSOR._8S5 //DB5.DBXxx.x
JCN M004

1. load Pointer ID for text list generation
2. load sensor address for evaluation
3. if ok move to next sensor and load pointer, If not ok jump to label M004

4 At label M004 there is a FC (not my effort) which uses the AR1 value to generate text to the user (M146.4 = 52)
52 in the text list will read "Waiting for Sensor xxx = On "

This is called every scan providing the station is set active

I hope this is clear, i'm terrible at explaining things.

I'd post the whole code but its big 120 networks +
 
Uff, I don't understand why to do it so complicate?! Why to use AR1 instead of direct message number? All sensors must be on in this code part, I see. Can you explain structure of "ST1".Sensor? Are sensors _8Sx defined as BOOL and placed in chain in that DB, without any another variables between?
 
Hi Gambrinus,
You are right, i would like to scrap it all, But i just dont have enough time allocated to this, Before production restarts (n)

You are correct the Memory bit Order, Sensor Order and Error Message Order all match sequentially (i made sure of this when i changed the sensor mapping). They are all BOOL Data format.

I'm working on a FC now, Its ****, but i think it will show best what i need to do.

Thanks again for your support!
 
I think another problem can occur. Timer starts counting from signal front. But if the signal doesn't change state, timer doesn't start counting...
 
seems an interesting one to have missed, work always gets in the way.

My 2peneth (late), I wouldnt use timers from this sort of thing, I woould usually create one shot bits from the CPU clock memory bits and use these as time bases for counting, fall back frpom S5 days of not trusting timers.
 
Timers can work if adressed indirectly. Unfortunatly I cann't find working example, but I have it. But 160 timers... It's too much. I wait for more information from STL. It seems he must use counting as you described, I agree.
 
Here's an idea - if the code already generates messages that say "Waiting for Sensor xxx" why not look in the message area (be it a DB or M bits), find the first bit on and then start timing. If the first bit on changes, restart the timing. If the timer times out, set your fault bit according to where you found the first on bit.
This code will run all the time at the end of your existing processing.

Assumptions:
Only 1 bit will on at any time,
A bit is on to indicate waiting for sensor
 
Assumptions:
Only 1 bit will on at any time,
A bit is on to indicate waiting for sensor

Good idea, but only an Int value is generated between 0 + 160 to display the message.

Right, ive had a good go at this, and although not perfect - PLCsim will run it.

My test program
i copied all the blocks i needed to simulate the process
FC82 - Criteria analysis(text value generator) original block
DB5 - St1 Sensors
DB11 - Alarm Messages
DB1 - Fault Timers
DB41 - Sequence DB for Station 1

OB1 Code

1. Opened DB41 which must be open for FC82
2. loaded a test pointer of M140.0
3. called FC82 - value generated and stored in DBW30 0f DB41
4. call my FC and use DBW30 as basis for all offsets
5. DB5,DB1 and DB11 are used within my function.

I need to do something, so if a sensor changes the accumulated value is zero'd.

Please feel free to Let me know what you think ;)
 

Similar Topics

Hi, I need to create a FC/FB to sort through DB error messages and prioritise them in the order of Importance. the values generated(x5)...
Replies
15
Views
4,513
Hello nice to meet you, im new in here, I'm currently trying to convert code written in STL for a S7-400 to SCL for an S7-1500, because when i run...
Replies
5
Views
320
Hi! I am working on a project were we will be replacing an 300 CPU with a 1500 CPU and we are working on migrating / converting code. There is a...
Replies
9
Views
1,079
Hello everyone, friends. I asked a similar question before, and you helped, but I'm very weak in STL and I'm having trouble learning it. What I...
Replies
2
Views
741
i hope you could help me to convert the network Stl to lad it's apart from program of machine and i try to find solution for the reason of error...
Replies
10
Views
1,933
Back
Top Bottom