Hi
I want to leave the Vx door excited in a known level during the execution of the program. In the forum, in other post's, I noticed that most of the solutions were to use the Delay function after ExciteV, locking the implementation of the program for a known interval of time. This is an unattractive solution for me. The program reads several sensors and is running in scans of 10 seconds
is there any way to make the port active port during execution of the program?
Const Speed1 = 100
Const Speed2 = 200
Const Speed3 = 300
Const PortBomba = 1
Const Stop = 0
Const Off = 0
Const On = 1
Public BattV
Public relogio(9)
Public TempCA, HRelCA
Public Speed
Public Bomba As Boolean
DataTable(Dados10m,True,-1)
DataInterval(0,10,Min,10)
Average (1,TempCA,FP2,False)
Maximum (1,TempCA,FP2,False,False)
Minimum (1,TempCA,FP2,False,False)
Average (1,HRelCA,FP2,False)
Maximum (1,HRelCA,FP2,False,False)
Minimum (1,HRelCA,FP2,False,False)
EndTable
BeginProg
Scan(10,Sec,1,0)
SequentialMode
Battery(BattV)
RealTime (relogio)
VoltSe(TempCA,1,mV2500,1,True,0,_60Hz,1.0,0)
VoltSe(HRelCA,1,mV2500,2,True,0,_60Hz,1.0,0)
If Bomba <> Off Then
PortSet(PortBomba,On)
If Speed >0 AND Speed < 25 Then ExciteV (Vx1,Speed1,100)
If Speed >=25 AND Speed < 50 Then ExciteV (Vx1,Speed2,100)
If Speed >= 50 Then ExciteV (Vx1,Speed3,100)
Else
PortSet(PortBomba,Off)
ExciteV (Vx1,Stop,100)
EndIf
CallTable (Dados10m)
NextScan
EndProg
Im changing the variable speed using RTMC.
With the CR1000 (and similar generation loggers) you can turn on a voltage excitation and leave it on, up until the point an analogue measurement is made or the scan finishes. Even if you make an analogue measurement that does not change the excitation it will still get turned of momentarily during the measurement and return to the same setting afterwards.
This is because some of the same internal hardware is used between the switched excitations and the A/D hardware. This is by design as it lets the logger take truely ratiometric measurements relative to the excitation outputs.
If you want to set an analogue output to a given value and leave it there no matter what, you either need a variant of the dataloggers with a CAO (continuous analogue output) port, e.g. the CR3000, or add an extra peripheral such as the SDM-A04 or SDM-IO16.