Control Logic SDM-SW8A and SDM16AC_Campbellsci论坛问答

Dear friends
I use cr1000, sdm-sw8a and sdm16ac as a control valve,
I want to make a condition when the button [input(5)] is pressed then Control(1) and Control(2) is on and Control(5) will be on too as condition that control 1 & 2 ready, but if one of them or both is off then Control(9) will be on,


========================
Public Control(16)
Public Input(8)

Control Logic SDM-SW8A and SDM16AC_Campbellsci论坛问答

BeginProg
Scan(1,Sec,0,0)

If (Input(5)=1) Then 'button
Control(1)=1
Control(2)=1
If (Input(1)=1 AND Input(2)=1) Then
Control(5)=1 'Start Indicator
Control(9)=0
Else
Control(5)=0
Control(9)=1 'error indicator
EndIf
Else
Control(1)=0
Control(2)=0
Control(5)=0
Control(9)=0
EndIf
EndIf
SDMSW8A (Input(),8,0,0,1,1.0,0)
SDMCD16AC(Control(),1,2)
NextScan
EndProg
=================

problem is Control(9) always on first and then Control(5) on, Control(9) seemed always read first the conditions of the 'else' then followed by Control(5)

Any idea how to solve this problem?
Any information would be greatly appreciated. Thank you.

新对话如下:

Some quick suggestions....

You have 1 too many Endif statements. Delete the one above your SDMSW8A (Input(),8,0,0,1,1.0,0) statement.

Try adding "SequentialMode" to the beginning of the program so the logger executes the statements in the order you have them programmed.

IslandMan

新对话如下:

Thank you IslandMan, I will try to do it this way

新对话如下:

anyway how to run CRBASIC program can walk step by step? in this case i used "If...EndIf" command, whether there are special arrangements in "Scan(...)" or there are special commands that must be added if using SDM, i'v tried to use "SequentialMode" but I don't see any change that affect, Thanks

新对话如下:

Lets try to get the logic worked out then we'll deal with the output.

What kind of switch you are using, momentary, on/off and how are the measurement jumpers set? (Pg6 in the manual)

新对话如下:

The problem have been solved, thanks for your idea, i used "SequentialMode" (like your advice and) "if TimeIntoInterval(x,x,x)" as a timer to wait the signal input in datalogger, but i must know the cable lengths used. Thanks IslandMan :D

Best Regard,


vai7strings

新对话如下:

Glad that you sorted it all out.
Regards,
IslandMan

分享到:

原文链接:,转发请注明来源!
海洋仪器网 仪器使用 Control Logic SDM-SW8A and SDM16AC_Campbellsci论坛问答
「Control Logic SDM-SW8A and SDM16AC_Campbellsci论坛问答」评论列表

发表评论