Beckhoff / TwinCat makng variable equal to input value

realolman

Member
Join Date
Mar 2009
Location
here
Posts
584
I have a beckhoff bc9000 that i am attempting to program using the twincat IDE.

How can I make the value of a variable equal to the value of an analog input, when a digital input goes true?

I am using ladder logic ... I am unfamiliar with the whole twin cat /beckhoff system....

I would like to make the integer variable "closed_position" equal to the value of Term_4KL3062_2_Data_In (an analog input)when Term_2KL2408_input ( a digital input) is true.

How do I go about doing that?


Is there a straighforward list of all the commands or instructions available for the bc9000 and how to use them somewhere?

thank you
 
Last edited:
See the attached. Use "Insert box with EN" command and type 'MOVE' in.

As far as the list of built-in operators - there is not much in TwinCAT help. You would have to search for any IEC61131 programming resources...

TwinCAT.jpg
 
Hey.... you are the man! thank you ....I was trying to use "equals" boxes and so on, but they made an "output" true rather than transferring the value.... thanks again.
 
I was trying to use "equals" boxes and so on, but they made an "output" true rather than transferring the value.... thanks again.

German software has traditionally been known for friendly interfaces, ease of use and intuitivity... oh well. Don't get disappointed by these quirks: TwinCAT is a very good, flexible and powerful system. One just has to get used to it.
 
I get the feeling that this is very good stuff... the support folks are great...Is there somewhere a person could learn to program this stuff on ones own... I never got to go to classes much for anything else in my life... I don't think this should be an exception. I don't wanna go to class.... I wanna read a tutorial and se an instruction set.

They sent me tutorials but none of them seem to tell you what you need to know... for example where is a place that tells you all the possibilities associated with the box. I've seen greater than, less than, equal, AND , snd now move. there are set and resets.... surely this stuff is in a list somewhere.
 
Last edited:

There is still a function I would like to incorporate... The cylinders need to close tightly and stay tight, and there seems to be a variance in the resistance of replacement cylinders. In order to compensate for that, we have been adjusting pots put in series with the cylinder resistors. That is a bit of a problem that I would like to try to eliminate

The post I made was to find out how to to read the feedback voltage of the cylinder when it was in the closed position, and then set a variable equal to that when a digital input was made true.. The problem that I did not consider was that the equipment will be powered down....


Now my question has become: is there a way I can make the value of that variable become permanent through a power down / up cycle without using the computer?

What I would like to do is position the cylinder, cycle a digital input, and have the value of the feedback voltage from the cylinder become transferred to something that is not lost through a power cycle.

Exactly what LadderLogic posted in post #2 except that the "closed_position" variable would be non-volatile somehow, until the rung was true again... the next time the cylinder was replaced
 
Just re-declare your variable as 'retain":

Code:
VAR RETAIN
  closed_position: INT;
END_VAR

and it will retain the last value via a power cycle. Note though that if you were to re-build and to re-download your program, the value of such a variable would still be overwritten with a default (if you are familiar with AB SLC500, this is a somewhat similar behavoir - the program offline data is downloaded together with the code).

Unlike the previous topic, there is some information available in TwinCAT Help - search for "RETAIN".
 
hey thank you so much... I believe this will make an aggravating thing much better.

thank you.

RATS!... it's telling me the current target does not support the 'RETAIN" flag

it's a BC9000
 
Last edited:

Similar Topics

Hi everyone, This is my first time posting, so please forgive any omissions or mistakes. I am attempting to control the velocity of a stepper...
Replies
18
Views
1,045
Hello, I was wondering if anyone know how to upload a PLC program to the Beckhoff TwinCAT 3 from a file? i.e. without having the development pc...
Replies
0
Views
761
Hi anyone got any tips and tricks?? I'm at a stage wherei need to tidy up my hmi project and give all objects sensible names, I did start this...
Replies
0
Views
965
Hello, I have a System running a beckhoff IPC with twincat 2 software on it, Also i have no original source code. Is it possible with the...
Replies
1
Views
1,271
Hi all, I've inherited someone else's program and can't for the life of me figure out his use of the # symbol in one of his structured text...
Replies
5
Views
1,924
Back
Top Bottom