Galil : 800-377-6329 Attn. RMA 37785 Galil Motion Control, Inc. 3750 Atherton Road Rocklin, CA 95765 11/19/04 fried again: RMA 37945 ********************************* Slot 0 (15-0) = Digital TTL Inputs 0,1,2 Luke Status,Fill Request,Overfull; 4,5 Luke Supply Status, Fill Request Slot 1 (35-32) = Relays - 32, 33, 35 Luke Fill; 34 is dead: 34, 35 Panel BNC's Slot 2 (71-64) = Digital OptoOUT - 64, 65 Panel BNC; 67, 68, 69,70, 71 New relay box Slot 3 (103-96) = Analog Inputs - 96, 97, 98, 99: TC 1,2,3,4; 100: Luke Supply Tank Pressure Slot 4 (135-128) = Analog Outputs - 128, 129: Panel BNC's Slot 5 (167-160) = Digital OptoIN - 160, 160: Panel BNC's Slot 6 (199-192) = Analog Inputs Front Panel Only: Slot 1 (35-32) = Relays - 34, 35 Front Panel BNC's Slot 2 (71-64) = Digital OptoOUT - 64, 65 Front Panel BNC's Slot 3 (103-96) = Analog Inputs - Slot 4 (135-128) = Analog Outputs - 128, 129 Front Panel BNC's Slot 5 (167-160) = Digital OptoIN - 160, 160 Front Panel BNC's Slot 6 (199-192) = Analog Inputs - 192, 193, 194, 195 Front Panel BNC's *************************************** example: READ ALL echo "TZ\r\n" | sock_exchange.tcl 192.168.4.154 80 7 "\r\n" 1 Slot 0 (15-0) = Digital Inputs - value 65502 (1111_1111_1101_1110) Slot 1 (35-32) = Relays - value 0 (0000) Slot 2 (71-64) = Digital Outputs - value 0 (0000_0000) Slot 3 (103-96) = Analog Inputs - values -1.1670,-0.3125,0.6689,1.5381,-1.3330,-1.0889,0.1807,0.1514 Slot 4 (135-128) = Analog Outputs - values 0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.4932 Slot 5 (167-160) = Digital Inputs - value 255 (1111_1111) Slot 6 (199-192) = Analog Inputs - values -1.2891,-0.4980,0.4492,1.5625,2.6172,2.9590,2.4023,6.8555 **************************************** ***************** TTL: Slot 0 (0-15) Digital Inputs IOM-70016 -- 16 TTL input module Command: "MG@IN[0-15]" reads TTL input (Note: DO use "[" and "]", and ONE number,only) Example: read the state of TTL #8 (which is #9 on the physical board): echo "MG@IN[8]\r\n" | sock_exchange.tcl 192.168.4.154 80 1 "\n" 1 TTL 0: Luke dewar Level Control power status (0 = ON) TTL 1 : Luke dewar filling? (0 = Yes, filling) TTL 2 : Luke dewar overfilled? (0 = Yes, overfilled) TTL 3, not used TTL 4: Supply dewar Level Control power status (1 = ON) TTL 5: Supply dewar filling? (1 = Yes, filling) TTL 6-15 not used ***************** Relays: Slot 1 (32-35) IOM-70404 -- 4 Dry Contact Relays Command: (Set Bit) "SB 32-35" to close(open) relays 1-4 can only specify one at a time. Command: (Clear Bit) "CB 32-35" to open(close) Example: close NO or open NC relay #1 (depends on how it's wired...) echo "SB 32\r\n" | sock_exchange.tcl 192.168.4.154 80 1 "\n" 1 get the state of relay #1: echo "MG@OUT[32]\r\n" | sock_exchange.tcl 192.168.4.154 80 1 "\n" 1 Relay 32 N.O.: toggle Luke fill state Relay 33 N.O.: open Luke Overfill pressure relief valve Relay 34 DEAD, (on Front Panel BNC) Relay 35 N.C.: Remove power from Luke fill control relay. This goes to a BNC on the front panel (Used to prevent luke from filling when it's in the "fill" state. ***************** Digital Outputs: Slot 2 (64-71) IOM-70508 -- 8 Opto-isolated high power output module Command: MG@OUT[64-71] Example: Read state of Digital Out #2: echo "MG@OUT[65]\r\n" | sock_exchange.tcl 192.168.4.154 80 1 "\n" 1 Turn on Digital Out #2: echo "SB 65\r\n" | sock_exchange.tcl 192.168.4.154 80 1 "\n" Turn off Digital Out #2: echo "CB 65\r\n" | sock_exchange.tcl 192.168.4.154 80 1 "\n" Outputs 64 and 65 available on the front panel BNC Luke Level Control: 67 is DC out 68 is SOL 1 Supply Dewar Control 69 is SOL 3 70 is SOL 4 EXTRA: 71 is SOL 2 ***************** Analog Inputs: Slot 3 (96-103) IOM-70808 -- 8 Analog input module Command: "MG@AN[96-103]" reads the voltage at Analog Input 1-8 Example: Read Analog Input #1 echo "MG@AN[96]\r\n" | sock_exchange.tcl 192.168.4.154 80 1 "\n" 1 AI 96, 97, 98, 99 on Front Panel BNC's ***************** Analog Outputs: Slot 4 (128-135) IOM-70908 -- 8 Analog output module Command: "AO (128-135), V" sets voltage to "V" for Analog Outputs 1-8, Include the ",". Example: Set Output #1 to 4.5 volts: echo "AO 128, 4.5\r\n" | sock_exchange.tcl 192.168.4.154 80 1 "\n" 1 Read value of AO #1: echo "MG@AO[128]\r\n" | sock_exchange.tcl 192.168.4.154 80 1 "\n" 1 >>> AO 128, 129 on Front Panel BNC <<<<< **************** Slot 5 (167-160) Digital Inputs: IOM-70108 -- 8 Opto-isolated output module Command: MG@IN[167-160] Example: Read state of Digital IN #4: echo "MG@IN[163]\r\n" | sock_exchange.tcl 192.168.4.154 80 1 "\n" 1 >>>>> FRONT PANEL BNC: 160, 161 <<<<<<<< **************** Slot 6 (199-192) Analog Inputs: IOM-70808 -- 8 Analog input module Command: "MG@AN[192-199]" reads the voltage at Analog Input 1-8 Example: Read Analog Input #3 echo "MG@AN[194]\r\n" | sock_exchange.tcl 192.168.4.154 80 1 "\n" 1 NOTE: to enter multiple commands on a single line separate them with a ";". **************************************** -------------> Hooking up Galil to Teragon's LC11 controller 1) Connect TTL Ground to LC11 Common TTL#1, IN01, ( which is #0 of inputs [0-15] ) to LC11 "F" terminal This will cause the TTL#1 to go low = 0 when it's filling, high = 1 when it's not Connect TTL#2 to "A" the Alarm status 2) Connect Relay #1 = bit32 Common to LC11 Common; #1 N.O. to LC11 "T" (for toggle); can then open and close, that is toggle current state of fill status by open or closing the Relay Here's the commands to send to the Galil: Check State of Relay :> echo "MG@OUT[32]\r\n" | sock_exchange.tcl 192.168.4.154 1 1 0.0000 (Relay is open) Check Fill Status :> echo "MG@IN[0]\r\n" | sock_exchange.tcl 192.168.4.154 1 1 0.0000 (It's filling) Close Relay :> echo "SB 32\r\n" | sock_exchange.tcl 192.168.4.154 80 1 "\n" 1 : (nothing returned, but how do we tell this to xos_exchange.tcl?) Check State of Relay :> echo "MG@OUT[32]\r\n" | sock_exchange.tcl 192.168.4.154 1 1 1.0000 (It's closed) Check Fill Status :> echo "MG@IN[0]\r\n" | sock_exchange.tcl 192.168.4.154 1 1 1.0000 (It's stopped filling) *********************** ---->>> Modifications to LC11 <<<---------- 3 jacks for TTL out: Status, Fill, Alarm 2 jacks for relays: Fill Toggle, Alarm ON (Can't turn it off, only on) Use DB 9: 1 2 3 4 5 6 7 8 9 DB9 Galil LC11 Wire Pin# terminal Block Color 1 ground Relay Common Blue 3 Relay #1 N.O. Toggle White 5 Relay #2 N.O. Alarm Brown 6 ground TTL Common Green 7 TTL #1, Status Black 8 TTL #2, Fill Orange 9 TTL #3, Alarm Red *************** ---->>> Modifications to LC2 <<<---------- tap into to LED's using 7-wire cable LC2 Status: Blue (0V) Red (+2.2V) Solenoid: Black (0V) Green (+2.2V) Use DB 9 to connect: 1 2 3 4 5 6 7 8 9 Pin# 1,2,3,4,5, N.C. DB9 Galil LC11 Wire 6 Grnd #3 Status 0V Blue 7 AI #3 Status +V Red 8 GrnD #4 Solenoid 0V Black 9 AI #4 Solenoid +V Green NO GOOD -- need isolated inputs --- wait for new card to come in... Card came in, but still no good -- status output not strong enough to power isolated input!? The output of this unit is actually ~4.5V AC, grounding the output's ground removed the AC componet, can now connect to the TTL of the galil, but the output is confusing... Connect STATUS to TTL#5; SOLENOID TTL#6 Power OFF & LC11 power OFF [00] Power OFF, & LC11 power ON [10] Power ON, FILL request OFF [01] Power to unit, solenoid FILL request ON [11] Power to unit, sensor's disconnected, [01] ----------->>> Omega Order <<<<<<<--------------- MPJ-K-F (Quantity: 8) $2.25 Panel Jack http://www.omega.com/pptst/MPJ.html MSS-04 (Quantity: 2) echo "TZ\r\n" | sock_exchange.tcl 192.168.4.154 80 1 "\r\n" 1 | awk '{gsub("[\r_()]",""); print $10}' | awk -F "" '{print "Supply: " $11,$12, " Sample Dewar: ", $14,$15,$16}' $2.00 Mounting Strip http://www.omega.com/pptst/MSS_Series.html MSS-02 (Quantity: 2) http://www.omega.com/pptst/MSS_Series.html $1.00 Mounting Strip PX242-015G5V (Quantity: 1) No web page for this item $159.00 0-15 psi Gauge transducer PX242A-005G5V (Quantity: 1) http://www.omega.com/pptst/PX242.html $159.00 0-5 psi Gauge transducer PSW-808 (Quantity: 1) http://www.omega.com/ppt/pptsc.asp?ref=PSW-800 $75.00 pressure switch *************************** set ethernet address: using windows software then issue the "BN" burn command to save to non-volatile memory computer Luke has a desktop short cut "Galil SETUP"; click on that and wait for it to find the Galil; highlight/select the Galil that it finds; click on "Assign" a new window opens with default I.P. address; select it; close; close; ************************************ READ TC OUTPUT: echo "XQ#READTC;WT1000;MG,T1,T2,T3,T4\r\n" | sock_exchange.tcl 192.168.4.154 80 1 "\n" 1 | awk '{print $2, $3, $4, $5}' READ LN2 DEWARS' STATES: echo "TZ\r\n" | sock_exchange.tcl 192.168.4.154 80 1 "\r\n" 1 | awk '{gsub("[\r_()]",""); print $10}' | awk -F "" '{print "Supply: " $11,$12, " Sample Dewar: ", $14,$15,$16}' ************************************************************************************************* ---------->> Analog input values by parsing the "TZ" command <<--------------- echo "TZ\r\n" | sock_exchange.tcl 192.168.4.154 80 4 "\r\n" 1 | awk '{ print ($2 == "3")? $9 : null}' | awk 'NF > 0' | awk 'BEGIN { FS = "," } ; { print $8 }' Here's a break down on the command, above: awk '{ print ($2 == "3")? $9 : null}' If the 2nd argument is "3" then we're on the line with Analog Output values; Printing the 9th record gives the "string" with all the AO values awk 'NF > 0' Prints the record if the number of fields is greater than 0, i.e., get's rid of the "nulls", (the lines which were reported as slots 0-2). awk 'BEGIN { FS = "," } ; { print $8 }' Set's the file separator to ",", and prints the 8th field. N.B. the AO's are printed in reverse order: 8th is 1st, 7th:2nd, 6:3, 5:4, 4:5, 3:6, 2:7, 1:8 ---------->> Reading 1st four TTL inputs by parsing the "TZ" command <<--------------- echo "TZ\r\n" | sock_exchange.tcl 192.168.4.154 80 1 "\r\n" 1 | awk '{ print $10}' | awk 'BEGIN { FS = "_" } ; { print $4 }' this gives, e.g., " 1101) " How to get rid of the trailing ")"? Who cares? *********************************************************************************************************** --------->>> INFO on sock_exchange.tcl <<<<-------------- usage: echo "command" | sock_exchange.tcl computername port lines terminator timeout where: command is the text you want to send to the remote computer computername is the name of the remote computer to connect to (default: localhost) port is the TCP port to connect on (default: 80) lines the number of lines you expect back in the reply (default: infinite) terminator the character sequence used to mark the end of a "line" (default: "\n") timeout number of seconds to wait for the reply before giving up (default: 30) ******************************** If a program begins with the label "#AUTO" and the program is saved in non-volitile RAM using the BP (burn program) command, then the program will begin execution automatically when the galil is powered up. Here's what's running as of 19 SEPT 05 mcfuser@graphics2:/luke/george 38% cat MASTER_LUKE2.dmc #AUTO 'Program to monitor LUKE #READTC 'Sub for Reading TC's COUNT=0 '"Variable Count set to zero K1=0 K2=0 K3=0 K4=0 #LOOP1 '"Sub called Loop V1=@AN[96] '"Set variable V1 = Analog Input 1 V2=@AN[97] '"Set variable V2 = Analog Input 2 V3=@AN[98] '"Set variable V3 = Analog Input 3 V4=@AN[99] '"Set variable V4 = Analog Input 4 WT 10 'Wait 10 msec COUNT=COUNT+1 'Increment variable Count K1=K1+V1 K2=K2+V2 K3=K3+V3 K4=K4+V4 JP #LOOP1, COUNT<100 T1=K1*100/COUNT 'Average Analog Output 1 T2=K2*100/COUNT 'Average Analog Output 2 T3=K3*100/COUNT 'Average Analog Output 4 T4=K4*100/COUNT 'Average Analog Output 4 'MG,"Average TEMPERATURE 1,2,3,4 = ",T1,T2,T3,T4 #FILLCRL 'Sub for dewar level control LKS = @IN[0] LKF = @IN[1] LKO = @IN[2] SPS = @IN[4] SPF = @IN[5] ONLYLUKE = @OUT[64] 'MG, SPF, SPS, LKO, LKF, LKS, ONLYLUKE IF (LKS = 0) IF (LKO = 0) 'Luke is Overfilled SB 68; CB 67; CB 69; CB 70 ELSE IF (LKF = 0) 'Luke Dewar Supply is on and Luke is filling 'turn ON LFpwr, turn OFF LVpwr, SFpwr, SVpwr SB 67;CB 68;CB 69;CB 70 ELSE IF (SPS = 1) IF (ONLYLUKE = 0) 'ONLYLUKE = 1 only if supply fill is inhibited IF(SPF = 1) 'MAIN Tank Supply IS on and requesting a FILL 'turn ON: Supply Fill and Vent OFF Luke Fill and Vent SB 69;SB 70;CB 67;CB 68 ENDIF ENDIF ENDIF IF (SPS =1) IF(SPF = 0) 'Tank Supply and Luke are both happy 'turn OFF all CB 67;CB 68;CB 69;CB 70 ENDIF ENDIF IF(SPS = 0) IF(SPF = 1) 'MAIN Supply is OFF 'turn OFF all CB 64;CB 65;CB 66;CB 67 ENDIF ENDIF ENDIF ENDIF ENDIF 'GET STATE of OPTO OUTputs LKFPWR = @OUT[67] LKVPWR = @OUT[68] SPFPWR = @OUT[69] SPVPWR = @OUT[70] 'MG, LKFPWR, LKVPWR, SPFPWR, SPVPWR JP #READTC EN ************** A better way to control the remote relays might be the use of the "OB" (output bit) command will check this out later...