Diff of /trunk/GPIOMods/SoftAIN/svnobj [000000] .. [r7]  Maximize  Restore

Switch to side-by-side view

--- a
+++ b/trunk/GPIOMods/SoftAIN/svnobj
@@ -0,0 +1,5 @@
+Gx_lÂ!0…jüo”/Hç‰ÅÁ áSystem.StringL{6f9dac99-8de1-4efc-8465-68ac443b7d08}SpecialFuncL{0db3d7bb-cde0-4416-9a7b-ce49a0124323}NoneImplementationL{3b83b776-fb25-43b8-99f2-3c507c9143fc}TextDocument	L{f3878285-8e4f-490b-bb1b-9acbb7eb04db}
+TextLinesL{a5de0b0b-1cb5-4913-ac21-9d70293ec00d}Id
longTagText.SysTimeGetUs(tCurrent);IF xInit THEN 	xInit := FALSE;(	tStart := tCurrent;END_IF	"IF xSampling THENd	// Reading the sampling pin, and measure the time	IF xInput THENj		/// capacitor is full, stop sampling, and discharge*		xSampling := FALSE;j		rVal := LWORD_TO_REAL(tCurrent - tStart) * crScale;*		tStart := tCurrent;	END_IFELSE 6	// Discharge the capacitor!P	IF tCurrent - tStart > ctDischarge THEN"&		// start sampling#$		xOutput := TRUE;$Interface%L{a9ed5b7e-75c5-4651-af16-d2c27e98cb94}&t/// This FB can be used to sample analog data by using two'/// GPIO Pins:(./// - one digital input)0/// - one digital output*///+n/// There are also other circuits out there, which only,|/// need one single GPIO. But they have the clear disadvantage-ˆ/// that they need to reconfigure this GPIO constantly. Additionally.ˆ/// you have to take care about the VRef, which you are using, as it/z/// will be pulled to ground by the GPIO acting as an output.0Š/// You need to take care to not destroy your board with that. In the1ˆ/// Circuit, recommended here, it is to my understanding much safer,2Š/// as we simply use the digital output as our VRef. Therefore we can3P/// easily and safely pull it to ground.4/// Wirering::56///   Digital Output (VRef)6///      v7&///   R1 (2,2kOhm) 8F///   Transistor / Poti / LDR / ...90///      |---> Input Pin:///   C1 (1uF);///     GND</// Scheduling:=š/// The accuracy of the measurement relies in some aspects on the scheduling.>˜/// So it is recommended to schedule the task, which is driving this FB, as ?¢/// frequent as possible. It is generally OK to combine this FB with the SoftPWM.@š/// Just the sampling accuracy will slightly vary, depending on the frequencyA /// of the PWM. B C,FUNCTION_BLOCK SoftAINDVAR_INPUTEh	xInput : BOOL; /// This Pin will measure your inputFEND_VARGVAR_OUTPUTHf	xOutput : BOOL; /// This Pin will act as your VRefIP	rVal : REAL; /// Sampled, analog outputJVARK$	xSampling : BOOL;L$	tStart : SYSTIME;M(	tCurrent : SYSTIME;N*	xInit: BOOL := TRUE;OVAR CONSTANTP^	// Define time to wait for discharging (in us)Q<	ctDischarge : SYSTIME := 100;R$	// Scaling factorSD	crScale : REAL := REAL#1000000.0;T"UniqueIdGeneratorU131VPOULevelWL{8e575c5b-1d37-49c6-941b-5c0ec7874787}XStandardY ChildObjectGuidsZ8System.Collections.ArrayList[,AddAttributeSubsequent\boolÐÐ-ÐÐ	E
+ÐÐ
­xÚÐ-ÐÐ
­tÚÐ-ÐÐ
­wÚÐ-ÐÐ
­yÚÐ-ÐÐ
­zÚÐ-ÐÐ
­{ÚÐ-ÐÐ
­sÚÐ-ÐÐ
­	ÚÐ-ÐÐ
­eÚÐ-ÐÐ
­fÚÐ-ÐÐ
­hÚÐ-ÐÐ
­jÚÐ-ÐÐ
­€ÚÐ-ÐÐ
­ƒÚÐ-ÐÐ
­iÚÐ-ÐÐ
­aÚÐ-ÐÐ
­gÚÐ- ÐÐ
­cÚÐ-!ÐÐ
­~ÚÐ-"ÐÐ
­|ÚÐ-ÐÐ
­ÚÐ-#ÐÐ
­}ÚÐ-ÐÐ
­bÚÐ-Ð$%Ð	E
+7ÐÐ
­)ÚÐ-&ÐÐ
­*ÚÐ-'ÐÐ
­+ÚÐ-(ÐÐ
­,ÚÐ-)ÐÐ
­-ÚÐ-*ÐÐ
­.ÚÐ-+ÐÐ
­/ÚÐ-,ÐÐ
­0ÚÐ--ÐÐ
­2ÚÐ-.ÐÐ
­3ÚÐ-/ÐÐ
­4ÚÐ-0ÐÐ
­5ÚÐ-1ÐÐ
­7ÚÐ-2ÐÐ
­8ÚÐ-3ÐÐ
­?ÚÐ-*ÐÐ
­@ÚÐ-4ÐÐ
­AÚÐ-5ÐÐ
­FÚÐ-6ÐÐ
­GÚÐ-7ÐÐ
­IÚÐ-6ÐÐ
­JÚÐ-8ÐÐ
­VÚÐ-9ÐÐ
­QÚÐ-:ÐÐ
­SÚÐ-6ÐÐ
­TÚÐ-;ÐÐ
­YÚÐ-*ÐÐ
­ZÚÐ-<ÐÐ
­[ÚÐ-=ÐÐ
­\ÚÐ->ÐÐ
­]ÚÐ-?ÐÐ
­_ÚÐ-@ÐÐ
­`ÚÐ-AÐÐ
­NÚÐ-BÐÐ
­ÚÐ-CÐÐ
­ÚÐ-DÐÐ
­
+ÚÐ-EÐÐ
­ÚÐ-FÐÐ
­ÚÐ-GÐÐ
­ÚÐ-HÐÐ
­>ÚÐ-IÐÐ
­ÚÐ-FÐÐ
­ÚÐ-JÐÐ
­ÚÐ-KÐÐ
­kÚÐ-LÐÐ
­lÚÐ-MÐÐ
­vÚÐ-NÐÐ
­ÚÐ-FÐÐ
­nÚÐ-ÐÐ
­mÚÐ-OÐÐ
­qÚÐ-PÐÐ
­oÚÐ-QÐÐ
­ÚÐ-RÐÐ
­‚ÚÐ-SÐÐ
­pÚÐ-FÐÐ
­ÚÐ-ÐT-UÐVW-XYZÐ[\­
\ No newline at end of file