Radio button with a DINT data type

Snap25

Lifetime Supporting Member
Join Date
Dec 2014
Location
Michigan
Posts
237
I'm missing something and cant seem to figure it out for the life of me!!

I have 3 tanks to choice from and only want one enabled at a time. A radio button fits perfect in the windows I need this to be at on the HMI(Wonderware BTW)


tank 1 = dose_tank_sel.0 tank 2 = dose_tank_sel.1 tank 3 = dose_tank_sel.2

I enter the dose_tank_sel as an I/O integer in wonderware and I can enable tank 1(dose_tank_sel.0) then tank 2(dose_tank_sel.1) but once i click on the 3rd button it activates tank 1 and 2....

I looked in the program and monitored that bit and was playing around if the bit reads "4" it will put a 1 in the Dose_tank_sel.2
 
My job is super stressful when I don't know what the hell I'm doing and have to literally figure everything out on the fly! Especially wants me to make our machines make our customers coffee at 5am on Tuesdays, jack them off on Wednesdays, fly to the moon for samples, oh, and then do its normal function.
 
looks to e like you are passing #1,2,and 3 from the HMI to an INT word in the PLC
then using the bits to control the process
try entering 4 in place of the 3
bit 0 =1
bit 1 = 2
bits 0 and 1 together = 3
bit 2 = 4
hope that helps
 
I attached a photo of the radio button. It only gives me the option to enter "hf_dose_sel" and the 3 buttons that are used for the tanks go .0 .1 .2 im guessing..


I was able to get the program to work but I dont like the way it looks or what I had to do.

11.jpg
 
I attached another photo. This is how I had to do the programming to make that radio button work.. since that 3rd button made .0 and .1 true

push button --- (XIC)tank select.0 --- (XIO)tank select.1 ----- (output)
push button ---- (XIC)tank select.1 ----(XIO)tank select.0------ (output)
pushbutton ---- (XIC)tank select.0 ----(XIC)tank select.1 ----- (output)

12.jpg
 
Last edited:
the code should work but without knowing exactly what is passed I don't know
what makes you think your passing in the value 0 would think you would pass in 1, 2 or 3 if its a number could they be passing in single bits and not the number in that case bits 0, 1 and 2 would be used
 
I'm not sure. I get confused every time I think about it. I'm obviously missing something.

All I know is when I hit use the radio button 1 (tank_sel.0) is true, button 2 (tank_sel.1) is true, and button three (tank_sel.0 and tank_sel.1 are true) so I just use those two buts inline for my 3rd tank. Throw XIO buts after the first two tanks.

I dont like doing that because it will probably confuse me down the road when i look at it
 
from what you describe you are passing in the number of the button
1,2,3
corresponding to the bits 0 and 1
when true
Bit 0=1
bit 1 = 2
1 + 2 = 3
the way you have the code is correct
bit 0 and not bit 1 for tank 1
bit 1 and not bit 0 for tank 2
bit 0 and bit 1 both for tank 3
just be careful not to use that same memory word for any other part of the program as unexpected results will happen
 
from what you describe you are passing in the number of the button
1,2,3
corresponding to the bits 0 and 1
when true
Bit 0=1
bit 1 = 2
1 + 2 = 3
the way you have the code is correct
bit 0 and not bit 1 for tank 1
bit 1 and not bit 0 for tank 2
bit 0 and bit 1 both for tank 3
just be careful not to use that same memory word for any other part of the program as unexpected results will happen


Thanks for the help. I'm still learning stuff everyday! Tomorrow the plant wants me to make the system be capable of analyzing DNA from dinosaurs and a clone push button on the HMI. I'll probably be back online tomorrow for more help.
 

Similar Topics

I'm trying to do my first application in factory talk view...and having done regular GUI programming in the past, I'm trying to duplicate the...
Replies
3
Views
5,820
I want to have some radio buttons in a panel view. Does anyone have any code for this? More detail: only one button can be selected at a time. If...
Replies
11
Views
4,919
I am drawing a complete blank this morning looking for a unicorn. I would like to install a device at a remote site that will gather the data...
Replies
15
Views
2,337
I'm installing a SCADA system that consist of reading data at a Wastewater Treatment Plant, Elevated water tank and 3 lift stations. My master...
Replies
5
Views
2,336
I would like to request everyone's help so i can enjoy the holiday seasons. Our PLC for our Ship Unloader (Allen Bradley) suddenly lost all...
Replies
4
Views
1,699
Back
Top Bottom