Beiträge anzeigen

Diese Sektion erlaubt es ihnen alle Beiträge dieses Mitglieds zu sehen. Beachten sie, dass sie nur solche Beiträge sehen können, zu denen sie auch Zugriffsrechte haben.


Nachrichten - shooter

Seiten: 1 [2] 3 4 5
16
oscat.lib fuer CoDeSys 3 / Re: Wago 750-461/000-200 und oscat
« am: 04. September 2013, 08:49:32 »
sehr einfach frage INT %IW0 ab die temperature ist dan einfach mit 10 zu teilen.
also 233 heist 23,3 grad

17
oscat.lib fuer TwinCAT/CoDeSys / Re: Oscat in Twincat XAE einbinden
« am: 04. September 2013, 08:45:49 »
use older version of oscat see answer above.

18
nachteil von alex ist integer, ich wurde vorschlagen um es in real zu tun. dan gibts auch kein probleme mit negativ werte.

19
oscat.lib fuer TwinCAT/CoDeSys / Re: Berechnung in ST
« am: 10. April 2013, 12:43:06 »
ja das geht gut, aber:

mach 20 als variable, also zwanzig:REAL:=20;
und die minus eins auch also minuseins:real:=-1;
ich hab die immer in global var stehen. dan bin ich sicher welches typ sie sind.

20
nee die fehler liegt bei WAGO die haben keine 16 bit nur 15 bit.
hatte schon lange her gemeldet, aber 16 bit ist fur advertising besser, aber ist nicht richtig.

21
Modulentwicklung / Module Development / Re: B&R Steuerung
« am: 03. Februar 2013, 20:33:41 »
bilgram kann immer die txt version benutzen und dann compilieren.
ich nehme sehr oft nur kleine teile der lib raus um zu benutzen.

22
the cycle time is visible in the task overview.
here you can also set your task takt like t#200ms etc.
when freewheel the time can change due to other tasks and interupt. watch the priority.

23
oscat.lib fuer CoDeSys 3 / Re: INTEGRAL Baustein für die Berechnung
« am: 03. Februar 2013, 20:26:53 »
die eingang ist real aber ein baustein 0-20 mA liefert ein word also erst umsetzen.
mit word_to_real.
dann ist die cos nicht fest und das ergibt kW probleme

24
oscat.lib fuer CoDeSys 3 / Re: Oscat BASIC in TwinCAT V3.0.3100.0
« am: 03. Februar 2013, 20:24:31 »
die basic ist fur version 2.3 von twincat

25
var:
zehn:REAL:=10.0;


rtemp:= (INT_TO_REAL(inputtemp))/zehn;
und nicht by 100 aber bei 10 dividieren

26
klima mensch
if you do this your delaytime is different from simulation (sim is very slow)

if you do this with a trigger by a timer it will shift every rising edge of it.

you can also put this in a separate task and have it timed on 1 second. then use N:=30
in this case the PLC_PRG has to be set on high priority (like 15)
and it should be in the task list as the only freewheeler.


27
beispiel:
raum ist 75 m3 gross 5x5x3
zuluft ist 1 m3/minute
dan ist nach einer minute also 74 m3 altluft da und 1 m3 frischluft. also 74/75% plus 1/75%
when mischung complett ist, anders gibt es also ein factor von zum beispiel 0.5


28
Bestehende Module / Existing Modules / Re: AIN1
« am: 16. Dezember 2012, 21:01:39 »
i have changed the calcs to be conform.
added a thinker to change the maxcode as this is also embedded in bit_0 and BIT_N

(* @NESTEDCOMMENTS := 'Yes' *)
(* @PATH := '\/Engineering\/signal processing' *)
(* @OBJECTFLAGS := '0, 8' *)
(* @SYMFILEFLAGS := '2048' *)
FUNCTION_BLOCK AIN2
VAR_INPUT
   in : DWORD;
END_VAR
VAR_INPUT CONSTANT
   sign_bit : INT := 255;
   error_bit : INT := 255;
   error_code_en : BOOL;
   error_code : DWORD;
   overflow_bit : INT := 255;
   overflow_code_en : BOOL;
   overflow_code : DWORD;
   Bit_0 : INT;
   Bit_N : INT := 31;
   out_min : REAL;
   out_max : REAL := 10.0;
   code_min : DWORD;
   code_max : DWORD := 16#FFFFFFFF;
   error_output : REAL;
   overflow_output : REAL := 10.0;
END_VAR
VAR_OUTPUT
   out : REAL;
   sign : BOOL;
   error : BOOL;
   overflow : BOOL;
END_VAR
VAR
   tB: DWORD;
END_VAR

(*
version 1.3   10. mar. 2009
programmer    oscat
tested by      tobias

Ain2 converts positiv and negativ signals from A/D converters or other digital sources to an internal real value.

*)
(* @END_DECLARATION := '0' *)
(* extract error bit *)
error := ((SHR(in,error_bit) AND 16#0000_0001) = 1) OR (error_code_en AND error_code = in);
IF error THEN
   out := error_output;
   RETURN;
END_IF;

(* strip off the data input *)
tb := SHR(SHL(in, 31 - bit_N), 31 - bit_N + Bit_0);

(* extract overflow bit *)
overflow := ((SHR(in,overflow_bit) AND 16#0000_0001) = 1) OR (overflow_code_en AND overflow_code = in) OR (tb < code_min OR tb > code_max);
IF overflow THEN
   out := overflow_output;
   RETURN;
END_IF;

(* extract sign bit *)
sign := (SHR(in,sign_bit) AND 16#0000_0001) = 1;

(* convert in to out *)
out := (DWORD_TO_REAL(tb - code_min) * (out_max - out_min) / DWORD_TO_REAL(code_max - code_min) + out_min);
IF sign THEN out := out-out_max; END_IF;



(* revision history
hm   23. feb 2008   rev 1.0
   original version

hm   16. mar 2008   rev 1.1
   added type conversions to avoid warnngs under codesys 30

hm   22. apr. 2008   rev 1.2
   corrected error in formula when code_min was set
   corrected error when sign bit was used
   optimized code for better performance

hm   10. mar. 2009   rev 1.3
   real constants updated to new systax using dot

pd 16 dec 2012
   added 2 complement and proposition to remove max code
   *)
END_FUNCTION_BLOCK

29
Bestehende Module / Existing Modules / Re: AIN1
« am: 13. Dezember 2012, 20:33:52 »
(* @NESTEDCOMMENTS := 'Yes' *)
(* @PATH := '\/Engineering\/signal processing' *)
(* @OBJECTFLAGS := '0, 8' *)
(* @SYMFILEFLAGS := '2048' *)
FUNCTION_BLOCK AIN2
VAR_INPUT
   in : DWORD;
END_VAR
VAR_INPUT CONSTANT
   sign_bit : INT := 255;
   error_bit : INT := 255;
   error_code_en : BOOL;
   error_code : DWORD;
   overflow_bit : INT := 255;
   overflow_code_en : BOOL;
   overflow_code : DWORD;
   Bit_0 : INT;
   Bit_N : INT := 31;
   out_min : REAL;
   out_max : REAL := 10.0;
   code_min : DWORD;
   code_max : DWORD := 16#FFFFFFFF;
   error_output : REAL;
   overflow_output : REAL := 10.0;
END_VAR
VAR_OUTPUT
   out : REAL;
   sign : BOOL;
   error : BOOL;
   overflow : BOOL;
END_VAR
VAR
   tB: DWORD;
END_VAR

(*
version 1.3   10. mar. 2009
programmer    oscat
tested by      tobias

Ain2 converts positiv and negativ signals from A/D converters or other digital sources to an internal real value.

*)
(* @END_DECLARATION := '0' *)
(* extract error bit *)
error := ((SHR(in,error_bit) AND 16#0000_0001) = 1) OR (error_code_en AND error_code = in);
IF error THEN
   out := error_output;
   RETURN;
END_IF;

(* strip off the data input *)
tb := SHR(SHL(in, 31 - bit_N), 31 - bit_N + Bit_0);

(* extract overflow bit *)
overflow := ((SHR(in,overflow_bit) AND 16#0000_0001) = 1) OR (overflow_code_en AND overflow_code = in) OR (tb < code_min OR tb > code_max);
IF overflow THEN
   out := overflow_output;
   RETURN;
END_IF;

(* extract sign bit *)
sign := (SHR(in,sign_bit) AND 16#0000_0001) = 1;

(* convert in to out *)
out := (DWORD_TO_REAL(tb - code_min) * (out_max - out_min) / DWORD_TO_REAL(code_max - code_min) + out_min);
IF sign THEN out := out-out_max; END_IF;



(* revision history
hm   23. feb 2008   rev 1.0
   original version

hm   16. mar 2008   rev 1.1
   added type conversions to avoid warnngs under codesys 30

hm   22. apr. 2008   rev 1.2
   corrected error in formula when code_min was set
   corrected error when sign bit was used
   optimized code for better performance

hm   10. mar. 2009   rev 1.3
   real constants updated to new systax using dot

*)
END_FUNCTION_BLOCK

shooter@home.nl

30
Bestehende Module / Existing Modules / AIN1
« am: 13. Dezember 2012, 20:24:33 »
wenn auch negativ signale wie bei wago -10/+10V input benutzt werden muss der letzte regel geandert worden in

IF sign THEN out:= out - out_max; END_IF
so with this change it will be AIN2 (done in my system

Seiten: 1 [2] 3 4 5