I am writing code in VB script.
The script will executing commands for programming, erasing, verfying hex code on microcontrollers in serial production.
The vbscript executes Commad line interface which is running similar like windows command prompt.
After Ppcli.exe is started from VBScript, some commands are sent to the com port. The commamds are shown below:
Get port, OpenPort , SetPowerVoltage 3.3, SetProtocol, EraseAll,Program, ...etc.
Everything works great, but here is the problem. I can send commands in sigle string (Open Port, Set Power, Erase... etc.) but this kind of sending has a big issue.
I can't read the response for the sigle command (OK or not OK) and I can't send the whole hex file at once, because programmer only supports programming, verifying line by line. This means I have to read line from file and send it to microcontroller 128 times.
I have to send 128 commands for write lines in sigle string which is really not the good solution.
I would like to write do while loop, but every time I close command prompt window, the ports is automaticly closed and the communication is lost :(
I would like to know if is it possible to write to command line in the way to send:
Open Port
Read if it is OK or not OK
Program line form hex file 1
Verify line 1
Program Line 2
Verify line 2
etc.
I really don't know what to do, since I am not able to communicate with the programmer in any other way than single string sending. But the string is then very long and there is no diagnostic if something goes wrong while programming:(
I was sure that CLI (command line interface) would be the best choice to program microcontrollers but now I am stuck, since I didn't know that it is only possible programming row by row and not the whole hex program at once :(
If you have any solution for me I would be glad.
Can I run Perl code from VBS? I also have working pearl example for programming devices?
Thank you,