QUOTE(RiverAmy @ May 18 2006, 08:36 AM) [snapback]34018[/snapback]
step 1 Send Display text to ML "Enter Tank"
step 2 Send Display text to ML " " (this is just a blank line)
step 3 Send Display text to ML "Tank 9"
step 4 Send Display text to ML "Tank 12"
step 5 Send Display text to ML "Tank 14"
step 6 Send a command that allows the operator to choose which tank they want to pump from
step 7 Send a command that reads the keypad (so i know which tank the operator has chosen)
step 8 put a timer for 90 seconds (this is just how long it takes to go to the enter batch screen)
step 9 Send a command to authorize the ML. see note*
step 10 (here is my problem) send a command to check the status over and over till i see an input returned. also, i'm checking for the Note sections below*
oh, i forgot it takes about 250 mSeconds to get the response back from the ML device. I'm thinking that i will need more timers. see note *
send a RQ command to Request flow rate of chosen ML. then add anyother ML that are on the chosen pump.
I will control the VFDs according to the info i get, i will use the Read Keypad to know which tank they want to pump from then when it's started (input true) i will add 400 gpm to the set point of a PID (inside PLC). and the same for when the stop is ture i will subtract teh 400 gpm from the PID. I request the flow rate from the MLs so that i know how much flow i'm sending and what i should be sending so i can adjust the PID too.
all the following info. comes from that status command of the ML...
* Note. i will only start the pump if the authorize command is true and the input (start) is true.
I will only do the authorize command if input is not true, keypad data pending is not true and tansaction and batch done are not true.
i will stop the pump only if i have authorize true, input not true, and if one of these are true...(transaction and batch done, or transaction in progress and batch done, or keypad data pending.
thanks for all the help
Amy
Amy - It will take some time to mock up some kernel code, but here are my general thoughts now reading what you have written. I suggest the following approach.
1. Create a UDT {User Data Type} called ML_Info_Structure. And then create tags called ML1 thru ML9 of type ML_Info_Structure. Or create an array of ML_Info_Structure with 10 entries.
2. The elements of the UDT ML_info_Structure would be the following.
A. Step_Number type DINT
B. Text1 type STRING "Enter Tank"
C. Text2 type STRING ""
D. Text3 type STRING "Tank 9"
E. Text4 type STRING "Tank 12"
F. Text5 type STRING "Tank 14"
G. Text6 type STRING Command String to Select Tank
H. Text7 type STRING Command String to Read Select tank
I. Text8 type STRING Command String to Authorize the ML
J. Enter_Batch_Delay Type TIMER
K ML_Authorized Type BOOL
L. RQ_Status_Flag Type DINT - { 1= Sending RQ, 2 = Waiting RQ, 3 = Receiving RQ }
M. Last_Flow Rate Type DINT
N. Pump_Selected Type DINT
3. Create a UDT called Pump_Info_Structure. And then create tags called Pump9, Pump 12 and Pump14 of type Pump_Info_Structure or create an array of Pump_Info_structure with 15 entries.
4. The elements of the Pump_Info_structure would,be the following:
A. Pump_Start type BOOL
B. Pump_Stop type BOOL
C. Pump_Running type BOOL
D. PID_Setpoint Type DINT
E. PID_Control_Variable Type DINT
F. Pump_Fault Type DINT [VFD Fault Integer from VFD}
5. For actual program I would create two subroutines one called ML_Sequence and one called Pump_Sequence. You will need to call ML_Sequence for each ML and then Call Pump_Sequence for each pump..
6. You will also need a Data Structure and Subroutine for the Prosoft Card communication.
Hope this is clear and helps.