BiggP

Members
  • Posts

    11
  • Joined

  • Last visited

Everything posted by BiggP

  1. In chapter 9.10.2 of the users guide, it outlines how to populate a channel from a text file. My question is, using a script that first clears the contents of combo boxes, would I be able to repopulate these combo boxes from a text file. Instead of passing the strings to a channel, I just pass them to a combo box, using object naming. So if StrIn is the value read from the file, instead of: mychannel = strtodouble(parse(StrIn,1,",") I use MyCombobox.addchoice=StrIn Repeated for every value in list
  2. Just a quick update on some of the items in this thread. I had to make a massive change to the whole system, originally the count displayed was the count from the modbus device * parts (welded) per cycle, which I then used to set the cell history (the six numbers below the main count from post #4) and the colours according to if the number was on target or not. Much to my dismay, a power cut one day highlighted the fact that the I/O has no retention, so all my effort to make the I/O count the figure to display, were a waste of time (unless we added a UPS but where is the fun in that). So I created some test channels as 'internal counters' that goes up when the figure from the I/O goes up, no matter what it is, all was fine except when the software was closed and opened (like a powercut) the first cell history figure was always way out (like 100), because it was fetching history from the I/O count still. I remember when you said about using 'onpaint' to set colours and I also have a run once at startup script for variable declaration and clearing the operator names etc etc. It inspired me to streamline the whole cell history thing as it was using about 15 sequences and was a bit hit and miss on the colours plus it was grouped on each of the history numbers rather than the cell, so now in the startup script, I declare the global variable for each cell 60 min history as an array: for(private.x=1, x<13, x++) execute("global prodhistcell"+x+"={0,0,0,0,0,0,0}") endfor Then setting the v.channels (which is count*parts per cycle) current count as prodhistcell[0], I have a preserved baseline figure and i can use [1] to [6] instead of [0] to [5] when setting the history changes: for(private.x=1, x<13, x++) execute("prodhistcell"+x+"[0]=V.OUTPUT"+x) endfor Then set the ten minute production figure based on the shift target for each cell at startup: for(private.x=1, x<13, x++) execute("global tenminhistcell"+x+"=celltarget"+x+"/48") endfor Then it begins another looping sequence, which counts to 600 then shifts the 6th to 2nd in prodhistcell to 7th to 3rd, subtracts the figure saved at [0] from the current count to get the 2nd in array ([1]) and replaces the first number with the current count, th loops. for the colours, they are all set red in 'onload' event, then use a switch statement comparing the figure from prodhistcell array to 'tenminhistcell' figure to set it either red or green using 'onpaint' event. Also, because I have created a component for all six on one cell, it will be very easy to duplicate to the other cells. I know I probably overuse execute statements and am nowhere near scripting efficient, but to replace 15 sequences and ridiculous grouping with a few loops at startup, one script and a group component that actually works is great and it may be a mish mash to a degree, but I just wanted to say thanks for all the pointers which helped me achieve this. I also thought a couple of screengrabs might highlight other features introduced: At the end of the morning shift, you can see now there are operators added to display plus some extra icons in bottom left. The operators were a request from the section manager, which are set at software open or shift change, with the possibility of setting 1 or 2 staff. It has also been added to logging so db can be searched by name of staff. The display alternates between 2 pages every 20 seconds, so the padlocks numbered 1 and 2 simply lock display on either page, the last icon is to add staff. Because of having 3 shifts and a lot of agency staff, making it easy for shift leaders to add staff to a list for the correct shift was giving me a headache for a while. In the end, i used combo boxes to retain string data (names) which using virtual keyboard and adding to relevant shift just added to combo box. when shift changes, the set operator boxes cover the main number display so they will get done ASAP. If you click a name in list then exit you will close (hide) set operator box. if you click the add person icon at bottom of page the keyboard pops up, you type the name and select the shift to add it to. Then it appears straight away. Also if you click add instead of exit, you can add second operator, see azeotech appeared in list since first example. It just shows how flexible daqfactory is capable of being, it has done absolutely everything I have asked of it (even if diacritics were a PITA)
  3. While creating a data capture system for weld cell production, a request was submitted to me for the ability to add operators names to each cell at every shift change. My employer is UK based, however we have a fair amount of Polish employees, so when it came to making a virtual keyboard with 26 latin and 9 diacritics for the Polish names, I stumbled on what seems to be a problem for many forum users over the years. Namely, using non-latin characters in non-unicode software that cannot be fixed by changing the codepage. If support for English plus one additional language's characters are required, there is a relatively straightforward way of achieving this: Open the control panel, select region(1), select the administrative tab(2), then in the language for non-unicode programs, click the change system locale button(3), choose desired language(4) and click ok(5) This is shown in picture below: Below is virtual keyboard when set to english (windows default) the red keys should be polish characters when entered using ALT codes: Below is same virtual keyboard with locale set to poland, which is correct: Below is virtual keyboard with locale set to russian, just to further test: I couldn't say what they represent, but some are recognisable to a non russian speaker (me). Anyway hope this helps someone, it is much easier than any other way
  4. Hi, Most of my choices for things come from the manual or the forum, I am inexperienced at coding, but learning slowly. I used the floor() so that I had a daily timer in seconds, for the shift changes and production target colouring. (V.TIME-shiftstart/28800)*CELLTARGET is how many parts should have been made to be on target, (V.TIME-shiftstart/32000)*CELLTARGET, is for 90% on target, so 4 hours into shift, with a celltarget of 200: V.TIME-shiftstart = 14400/28800 = 0.5*200 = 100, if output >= 100 production is on target and green is applied V.TIME-shiftstart = 14400/32000 = 0.45*200 = 90, if output >= production is 90% on target and orange is applied There is actually a mistake on my part the last case example should contain 32000 not 28800 so that if output is less than 90% it applies red
  5. Update: I had to make a change to the display, so that the main counter for each cell was green if on target, orange if 90% on target and red for any less. like below: I remembered what you said about using the 'onpaint' event, so for this I added the following in the onpaint: switch case(V.OUTPUT1>=(((V.TIME-shiftstart)/28800)*CELLTARGET1)) foreColor=RGB(0,255,0) case(V.OUTPUT1>=(((V.TIME-shiftstart)/32000)*CELLTARGET1)) forecolor=RGB(255,128,0) case(V.OUTPUT1<(((V.TIME-shiftstart)/28800)*CELLTARGET1)) forecolor=RGB(255,0,0) endcase Where CELLTARGET is amount expected in a shift on each cell (shift=28800 seconds), V.TIME is the number of seconds since midnight (Using Floor(SysTime()%86400)), shiftstart is when a new shift starts (in seconds since midnight) and V.OUTPUT is the count*number made per cycle. This is for cell1 and i pasted into then changed the variables for cells 2 to 12, but it works a treat, thanks for another great tip
  6. Thanks for the comments: 1) I try 2) This was quite a trial for me to complete, but in this case, because each part assembled has a different production target (there are 24 parts, and half of them can be made on multiple cells) then I needed to keep them independantly coloured. I assumed that the colour would not move through the array with the variable so felt as it is only 72 vatiables to assign colour to then to do them all every time was easiest for me 3) I did look at using an event, but couldn't find OnChange for variable values! I now realiuse that it is OnPaint. Same reasons as (2), which I suppose leads me to ask, if tenscellx[0] is assigned a colour, when it moves to next position in array ten minutes later, if that position had no colour specified, would it retain the colour it has been given, or would it default to black? 4) When I find out, I'll share the info.
  7. Hi, Thanks for your suggested solutions, it was the channel numbering on the test channels, which I am using for keeping hold of data. I didn't want to use registry variables as we don't have the PC it will run on yet. I appreciate the tips regarding execute and doubletostr. I have dropped using doubletostr, but kept using execute (and now evaluate also) as I am not a well versed programmer and now I have all but finished the main display and it has a page refresh of 35-37ms I am happy with that. Especially as that is on my decrepid FX-8320 and it will be moving soon to a nice shiny new ASUS PN-51 mini PC with Ryzen 5 5300U CPU which has a 62% improvement for single threaded performance and ability to extend a desktop over 4x 4k displays (with the aim of creating a single page extended over 2 displays for 12 weld cells). The main part of the app that was unfinished before was the cell history (under label 'LAST 60 MINS' on screenshot) this is done now and for a non-programmer I think I have done ok, each cell has 6 variable values named tenscellx where x=cell number and are an array of 6 values. Every ten mins a sequence is started that adds CELLx[0]-CELLx[600] to start of array and it loses the last value. Then it compares the production target for each cell /48 (ten mins) to tenscellx[0] to [5] where x is 1 to 12 and if it is more than the production target it displays green, otherwise it displays red. This was a vast improvement over crimson 3.0 (red lion) which was 100+ lines of code and a lot more settings. All I had to do was set a name for each component grouping the first value, second value etc in all cells, then use the code after the picture in the sequence. It works differently to the threshold settings (it is more a conditional colouring) and i noticed on the forums a lot of requests for something like this, so maybe it will help someone else. The code is after the picture //setting colour for cell history (TENCELL1=0, TENCELL2=3, TENCELL3=0 they are all in group TENCELLS) global string cellgroup = {"TENCELLS","TWENTYCELLS","THIRTYCELLS","FORTYCELLS","FIFTYCELLS","SIXTYCELLS"} global string celltens = {"TENCELL","TWENTYCELL","THIRTYCELL","FORTYCELL","FIFTYCELL","SIXTYCELL"} global thiscell=0 global allcells=1 global string cellcomp //while loop cells 1 to 12 while(allcells<13) //while loop tenscell(allcells)[0] to [5] The variables in use are tenscell1={0,0,0,0,0,0} tenscell2={3,7,7,8,7,8} and so on, the iif sets the RGB code depending if it is higher or lower than the target and the execute sets the colour with component naming. while(thiscell<6) cellcomp = celltens[thiscell]+allcells global string strfc = iif(evaluate("tenscell"+allcells+"["+thiscell+"]<TARGET"+allcells+"/48"),"RGB(255,0,0)","RGB(0,255,0)") execute("component."+cellgroup[thiscell]+"."+cellcomp+".forecolor="+strfc) thiscell++ endwhile thiscell = 0 allcells++ endwhile I hope this can help if someone needs this type of colouring
  8. Please bear in mind this is a work in progress, but I thought some screenshots might help you understand what I am doing as a whole
  9. Hi, I am setting up a shop floor data capture from 12 robot wekding cells just to monitor production and I have come across a problem with the execute() function that have got me baffled. For each weld cell, there are 3 test channels to retain information - the part number being assembled (PARTCELL1 to 12) although this is just a number in a list as they are strings, the number of parts per cycle (PPC1 to 12) and the production target number (CELLTARGET1 to 12). The production target can be changed so for retaining the changes there are also channels TARGET1 to 24 (there are 24 parts in production). Using 2 dropdowns cellpick and partpick, the parts being assembled can be changed in any cell, which changes the prodution target also. For displaying data there are global variables corresponding to the output of the dropdowns (partlist, targetlist, ppclist) using arrays and 2 buttons for changing the prodution target and setting the part to a cell. This is where things start getting a little screwy, the set to cell button runs a sequence that executes two commands, I have tried seperating them to 2 sequences, assigning them to string variables before executing etc etc but I still get the same problem, the picture below will explain: Further to this, ?PARTCELL1=9, but if I ran the first command again then the output of both ?CELLTARGET1 and ?PARTCELL1 would be 200. I can't prevent one from changing the other, no matter how I try, please help
  10. Thanks for info, in all honesty there isn't a huge amount of complexity (yet) and the 50% i have done is the backend stuff mostly. Current page draw time = 6ms but it not going to be running on my PC. Thanks for the single thread tip, will make choosing suitable CPU easier. While on the topic of hardware, is there any issues caused by amd/intel for cpu and amd/nvidia for gpu. I only ask because all too often it is a thing
  11. Hi, I just have a general purpose sort of question for whoever is listening. Having outgtown our Red Lion Controls Productivity Stations pretty poor resolution, to count weld cell production (5 years ago = 4 cells, now = 12 cells), I started looking around for the right alternative, without resorting to a second Red Lion setup. 720p for monitoring 12 cells is just too restrictive - so I found this great piece of software (yes DAQFactory) which does what the PTV does so much better plus there so much more I could do and for lower TCO. I recreated in 80 lines of code what took over 200 lines PER CELL on the PTV to pass part names, low and high production targets, parts per cycle snd more. I mean 80 lines for all 12 not per cell so kudos. I digress, all I actually would like to know is anyone using DAQFactory outputting to 4K resolution or WUHD ultrawide format (5120x2160) and if so what GPU are you using please? I've had to learn Modbus to communicate with our E3 i/o unit, had to push my lame coding ability way out of my comfort zone, have completed about 50% of project and still got 12 days trial to go, but gotta say this software is just the job, thanks