--- 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л[\Г