Hi, can anyone please help with logic for looping in SoMachine basic? I have a hopper that i need to open and close a valve until it reaches a certain weight.

Thanks.

Ken Roach

February 26th, 2018 11:06 PM

Welcome to the PLCTalk forum community !

In general, most PLC operating systems run designated programs repeatedly, in a constant "loop" or "scan". You don't have to do jumps or GOTO statements, but rather simply configure the routines to be executed by a repeating operating system task.

What model of Schneider controller are you using ?

My understanding is the SoMachine Basic is essentially a re-skinned version of CoDeSys, so you're going to have Tasks, and you're going to put your ladder logic routine (POU, in CoDeSys terminology) into one of those.

Describe your programming challenge in as much detail as you can, and practice with making screenshots with the Windows Snipping tool, then cropping them and attaching them to your posts as PNG files.

Beau79AU

February 27th, 2018 12:34 AM

Im using an M221 controller. I have a hopper on load cells, receiving a 0-10v signal. I need to open the valve to release a bulk lot of material until it reaches a slow feed weight, then open and close the valve on 3 sec intervals until it reaches the final weight. I have the bulk section sorted i just need to do the last slow feed. I have attached what i have for the bulk side. Please note MF0 is just a dummy for the analog input for using in the simulator.

Beau79AU

February 27th, 2018 12:37 AM

1 Attachment(s)

Sorry didnt upload screen shot

Beau79AU

February 27th, 2018 02:15 AM

3 Attachment(s)

I have come up with the attached. When i do not have the Final Dumps POU, it works. The valve opens until i get below the weight it is set for. But as soon as the Final Dumps POU is added the valve wont open at all.

Beau79AU

February 27th, 2018 07:07 AM

3 Attachment(s)

I have managed to get it to work with the attached, however i am having to use 2 outputs to open same valve, one output to open and close in the bulk dump and then another output to open and close on the light dumps. When i try to use the one output it does not open and close. Is there any way to use the one output?

Thanks.

Dravik

February 27th, 2018 08:13 AM

1 Attachment(s)

You can 'branch' your logic to use just 1 output.
Lots of ways to do this, here's a really simple example.

Beau79AU

March 8th, 2018 05:16 PM

Thanks Dravik, being new to PLC world, i didnt even think about branches. Works a treat now.