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.

Control Logic SDM-SW8A and SDM16AC


vai7strings Nov 4, 2009 06:35 AM

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)

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.


IslandMan Nov 6, 2009 12:03 PM

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


vai7strings Nov 7, 2009 06:52 AM

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


vai7strings Nov 11, 2009 08:49 AM

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


IslandMan Nov 14, 2009 08:17 PM

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)


vai7strings Nov 18, 2009 08:51 AM

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


IslandMan Nov 19, 2009 11:21 AM

Glad that you sorted it all out.
Regards,
IslandMan

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