Our full technical support staff does not monitor this forum. If you need assistance from a member of our staff, please submit your question from the Ask a Question page.


Log in or register to post/reply in the forum.

Problem with mesures of t107and cs616 with mux AM16/32


FB5802 Mar 13, 2020 02:51 AM

Hello,

I have a problem wtih this program, but i don't Know if the problem is the program or if I make an error of wiring.

i have to measure 10 T107 and 17 cs616

When I make a mesureament, i don't have problem with CS616 but with the T107.

I have spikes of  all 107 sensors mesureament, the 107 sensors have all the same spikes of theirs signals.

Could you say me if the problem could be the program ?

Thank you for your help

Public PTemp, Batt_volt
Public i,k
Public flag1 As Boolean
Public flag2 As Boolean

'---------------------------------------

Public rTime(9)
Alias rTime(1) = Annee
Alias rTime(2) = Mois
Alias rTime(3) = Jour
Alias rTime(4) = Heure
Alias rTime(5) = Minute
Alias rTime(6) = Seconde
Alias rTime(7) = uSeconde
Alias rTime (8) = Jr_sem
Alias rTime (9) = Jr_an
'----------------------------------------

'------------------
Public period(17)
Alias period(1)= a31_15
Alias period(2)= a31_15_2
Alias period(3)= a31_15_3
Alias period(4)= a31_45
Alias period(5)= a31_45_2
Alias period(6)= a31_75
Alias period(7)= a31_75_2
Alias period(8)= a31_105
Alias period(9)= a31_105_2
Alias period(10)= a31_135
Alias period(11)= a31_135_2
Alias period(12)= a31_165
Alias period(13)= a31_165_2
Alias period(14)= a31_195
Alias period(15)= a31_195_2
Alias period(16)= a31_235
Alias period(17)= a31_235_2

'------------------
Public temp(10)
Alias temp(1)= a31_t15
Alias temp(2)= a31_t15_2
Alias temp(3)= a31_t15_3
Alias temp(4)= a31_t45
Alias temp(5)= a31_t75
Alias temp(6)= a31_t105
Alias temp(7)= a31_t135
Alias temp(8)= a31_t165
Alias temp(9)= a31_t195
Alias temp(10)= a31_t235
'Declare Private Variables
'Example:
'Dim Counter

'Define Data Tables.
DataTable (tdr_a31,1,1000)
Sample(17,period(),fp2)
EndTable

DataTable (temp_a31,1,1000)
Sample(10,temp(),fp2)
EndTable

Sub tdr
RealTime (rTime)
'Scan (2,Sec,1,1)
MuxSelect (C2,C1,20,1,1)
For i = 1 To 17
CS616 (period(i),1,1,C3,1,1,0)
i = i+1
CS616 (period(i),1,2,C3,1,1,0)
i = i+1
CS616 (period(i),1,3,C3,1,1,0)
PulsePort (C2,10000)
Next
PortSet (C1,0)
PortSet (C2,0)

PortSet (C3,0)
flag1=false
EndSub

Sub T107
MuxSelect (C2,C1,20,7,1)
For k = 1 To 10
PortSet (C3,0)
Therm107 (temp(k),1,1,Vx1,2000,_50Hz,1,0)
k=k+1
Therm107 (temp(k),1,2,Vx1,2000,_50Hz,1,0)
k=k+1
Therm107 (temp(k),1,3,Vx1,2000,_50Hz,1,0)

PulsePort (C2,10000)

Next
PortSet (C1,0)
EndSub

BeginProg
Scan (30,Min,2,0)
RealTime (rTime)
PanelTemp (PTemp,60)
Battery (Batt_volt)


'******************************************
MuxSelect (C2,C1,20,1,1)
For i = 1 To 17
CS616 (period(i),1,1,C3,1,1,0)
i = i+1
If i > 17
ExitFor
EndIf
CS616 (period(i),1,2,C3,1,1,0)
i = i+1
If i > 17
ExitFor
EndIf
CS616 (period(i),1,3,C3,1,1,0)
PulsePort (C2,10000)
Next
PortSet (C1,0)

PortSet (C2,0)

PortSet (C3,0)

'*******************************************
Delay (0,500,mSec)

'mesure des 107
'+++++++++++++++++++++++++++++++++++++++++++
MuxSelect (C2,C1,20,7,1)
For k = 1 To 10
PortSet (C3,0)
Therm107 (temp(k),1,1,Vx1,2000,_50Hz,1,0)
k=k+1
If k > 10
ExitFor
EndIf
Therm107 (temp(k),1,2,Vx1,2000,_50Hz,1,0)
k=k+1
If k > 10
ExitFor
EndIf
Therm107 (temp(k),1,3,Vx1,2000,_50Hz,1,0)

PulsePort (C2,10000)
Next
PortSet (C1,0)
'***************************************************
CallTable tdr_a31
CallTable temp_a31

If flag1=true Then
Call tdr
flag1=false
EndIf

If flag2=true Then
Call T107
flag2=false
EndIf


NextScan
EndProg

Log in or register to post/reply in the forum.