Auto Com ?

Discuss Control Systems here
User avatar
JB_AU
Posts: 171
Joined: Tue May 21, 2013 11:01 pm

Re: Auto Com ?

Post by JB_AU »

Helps to not turn ruby off!

I now only need to add some delays , but most importantly stop the module from firing until i have entered the vid & pid.
I dare say i have to wrap that ruby descriptor code into an if statement or something simpler & wait for the button to be pressed.

Oh my, round & round i go.

regq_autocom.fsm
(30.83 KiB) Downloaded 3671 times
"Two things are infinite: the universe and human stupidity; and I'm not sure about the the universe."

Albert Einstein
User avatar
JB_AU
Posts: 171
Joined: Tue May 21, 2013 11:01 pm

Re: Auto Com ?

Post by JB_AU »

I'm just stuck, when no port is found it gives a message , after acknowledgement i need to reset the counter & clear the descriptor values.
Then it's finished & can go into 'user examples' , where someone can add polish.
This project i started when i got the flu weeks ago.

I knew the windows registry holds current ports of active hardware & previous ports, but nether the same port for different hardware to reduce conflicts.
The KEY i was interested in was 'HKLM\SYSTEM\CurrentControlSet\Enum\USB\' , so i needed to look at the Device Descriptor VID(VendorID) & PID(ProductID) & do a recursive search. Knowing that a usb device is either SI(SingleInterface) or MI(MultipleInterface).
I use ShellExecute to load REG.EXE & Thanks to 'TheOm' i used his ruby code so i could do a recursive search, I then filter the results with "Trogluddite's" stringystuff filters.
Compare the array of known useable ports from 'ComPort' module & 'and' them against the current interface in registry 'MI0x' looking for the value that exists in both arrays.
The cycle is repeated until either a 'Port' value is found or 'No' value is found, where the latter 'Nubeat's' messagebox asks to check the hardware.

And of course just some finishing touches needed.

regq_autocom_rev.fsm
Rev0.0005
(30.77 KiB) Downloaded 3680 times
"Two things are infinite: the universe and human stupidity; and I'm not sure about the the universe."

Albert Einstein
Post Reply