Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - dmroeder

Pages: [1]
1
Application Showcase / Data Tracking
« on: July 28, 2023, 06:39:36 PM »
I had a customer with some pallet data tracking issues that I was debugging remotely.  I added a rung that put the key data in one place to make it easier to watch.  Though, it was still difficult to monitor.  Then I thought, wait a minute, why not use AdvancedHMI to visualize this, so I took 5 minutes to plunk some 7 segment displays on a form, saw the issue within the first couple of minutes of watching the screen.

It was a conveyor trunk line from left to right, which product enters from left and from the bottom on those 7segs that have 1,2 and 3.  They are unloaded on the right.  It wasn't meant to be pretty.  It saved me quite a bit of time, I figured out where it was going wrong when the first pallet went through the system.

2
Open Discussion / Official Raspberry Pi Touchscreen
« on: September 14, 2015, 03:45:39 PM »
Anybody check out the Raspberry Pi touchscreen?  I have one of those Tontech(ish) 7" displays and I must say, I'm now regretting buying it.  The official screen looks a lot better and integrates much better (power, mounting, connecting).  The Tontech was a bit of a pain to setup too with re-compiling the kernel and in my case dealing with xinput_calibrator to calibrate it. 

http://makezine.com/2015/09/08/now-on-sale-the-official-raspberry-pi-7-touchscreen/

3
Tips & Tricks / Using textbox value in a loop
« on: November 05, 2013, 11:04:04 AM »
I did an experiment a while back for fun and I learned something about using text boxes in code (or any object for that matter).  The basic idea was to figure out what was in a password text box using brute force (one character at a time).  The reason I was doing this was because my wife had a really crappy password and I wanted to see how long it would take a processor to take to get a match by brute force.

It's a really silly experiment I know, and probably isn't the way that the real world works but I learned something that I thought was valuable (and probably common knowledge to real programmers):  Don't directly reference form objects in loops.  Read their state in code and use that variable instead (or at least in loops).  Here's what I mean:

Lets say the user is going to enter a single number and we wanted to use a loop to see when it is equal to 8:
Code: [Select]
'This way is slow
for i = 0 to 9
     if textbox1.text = (i) then  MessageBox.show("Success!")
next

Code: [Select]
'Faster
dim enteredValue as string = textbox1.text
for i = 0 to 9
     if enteredValue = (i) then MessageBox.Show("Success!")
next

Now a loop that is 0 to 9 isn't really significant but if you had a loop that requires many more operations, it can add up.  Here's an example.  In my test program, I entered 1234 into my password box and used some loops to increment characters one at a time until I got to the value.  1234 took 16,273,901 operations before I got to the value of 1234, which was 37.8 seconds.  In this example, I was comparing my incremented value directly to the text box (my first code example).  If I change the code to read the value of my textbox and store it in a variable (my second code example), then use the variable to do the compare, the time is cut to 1.9 seconds.

4
Application Showcase / Reading/Writing Tags
« on: May 14, 2013, 02:22:36 PM »
I made a little program that we can send to our customers to read/write tags in the event that they are having trouble.  We can use it to help them troubleshoot, or make adjustments without having to send service techs out.

A while back a customer started running a different product on their machine which exposed an issue with timer based filter we had on a sensor.  We had nobody available to send out to help them at the time, so we sent them this tool and they could adjust the timer preset.

I also added the ability to read multiple tags at once (the lower text box).  If we need to know the values of multiple tags, we just send them a text file that lists the tags.  They drag and drop it into the text box and it will read them and display the tag read and their values. 

Not the prettiest, but gets the job done.  There are other things that it does, but I figure this is the only thing that anymore might care about.



5
I think it would be nice to be able to write arrays of more data types using the EthernetIPforCLX driver.  Right now array writing is limited to integer formats only.  String and Real data types would be handy if it is possible. 

Pages: [1]