Multiple instances of IDE v18 on Windows XP?

When developing code to enable two or more Arduinos to communicate and/or handshake with each other (e.g., over xBee or I2C), I am accustomed to running two or more instances of the IDE for each USB-connected Arduino 328 on my Windows XP system.

In this way, I can use the COM windows to watch the program execution and the dialog between the Arduinos. This greatly facilitates debugging.

It appears that v18 does not support multiple instances, however. Let's say that I have two Arduinos: #1 and #2. I plug Arduino #1 into an available USB port and invoke an instance of the IDE, selecting the COM port that Windows assigns to Arduino#1. Then, I plug Arduino #2 into another USB slot, and invoke a second copy of the IDE. I then select the COM port that Windows has assigned to Arduino #2. Doing so, however, switches the COM port assignment for the original instance of the IDE, making all copies of the IDE now connected to Arduino #2.

I hope this makes sense because I really need this multiple-instance control over multiple Arduinos. Thanks for anyone's idea what I might be doing wrong. Is there a better way to monitor multiple Arduinos while in debug/code editing mode?

I have never tried to run multiple serial monitor windows. I thought changing the tools/serial port or board settings was a global change.

When i need more than one serial connection i use putty or another terminal program.

This risk did not exist with previous versions of the IDE. Prior to v18, each IDE kept correct track of its respective Arduino.

Hmm, I did not really try before 0018 but I have noticed that in 0018 and nearly (temporarily) bricked a few arduinos by loading on code for a different board...

Mowcius

I have used similar testing methods (monitoring multiple running Arduino boards), not by having multiple instances of the IDE loaded but by loading multiple instances of a PC serial terminal program called brey-terminal. brey terminal has a connect/disconnect button on it allowing it to release the comm port (but remain loaded) so the IDE can have it back if you want to do a new upload. The Arduino IDE does also release the comm port after uploading so everyone is happy working together. This serial terminal program has lots of features like macros, save to or send from file, etc. brey terminal is a standalone single EXE program and free so it's a winner in my book. :wink:

Lefty

but to have multiple instances of the IDE up and running their respective code segments correctly connected to respective COM ports for the duration of the debugging session so that multiple sketches could be tweaked

Can't you do the same thing with a single instance of the IDE, but with loading multiple sketches from the opening IDE window? At least that seems to work for compiling on version 18. I'm able to open the blink example sketch from the opening IDE window and it gets it's own new IDE window and I can set it's comm port and board type. I then from the original IDE window open another example, blinkwithout delay, and it gets it's own new IDE window with it's own option of board type and comm port. They both seem to compile without errors. I have not tried to download with two different boards connected, but I don't see why that wouldn't work.

I think the only conflict is with the serial monitor. If I select the monitor from either window, only one monitor window remains opened and it assumes the comm port from the last window it was selected from.

Lefty

Meanwhile, it appears the only solution is to have a separate computer for each Arduino. In other words, if you have three Arduinos, each with a different sketch, talking to each other over I2C or xBee, one must have three separate computers (Windows XP in my case), each running ONE instance of the IDE, with the three CRTs and three keyboards placed close enough to each other so the programmer can watch output on the three computer screens for the debugging and use the three keyboards for code tweaking.

Sounds like my desk :stuck_out_tongue:

Mowcius

Ordinarily one must use software from Microsoft or IBM to experience usage barriers like this.

Or some of my code... :sunglasses:

Amen, brother Paul. Ain't it the truth.

Incidentally, I've be exploring the behavior of v18 with respect to Window inheritance.

Being mindful of the inheritance from one window to another - there in may lie the solution....

uberhund

None of the quoted response content posted by others now show up in any of your posts. Have you been deleting some of your posts in this thread? Real confusing. :wink:

Lefty

It wasn't uberhund that I was quoting, so I don't think he's the one deleting posts.

It wasn't uberhund that I was quoting, so I don't think he's the one deleting posts.

Wasn't me!

My apologies, folks. I did indeed delete some of my posts to shorten this thread before posting my solution. I evidently just made things worse. In any case, I hope the illustrations below help lay out the problem and a remedy.

Let's say I have two Arduinos I want to monitor and edit separately, but also simultaneously. Assume Arduino #1 runs the "Hello World" sketch and is associated by XP with COM12. Arduino #2 runs the "DigitalReadWrite" sketch, and is associated by XP with COM3.

Here's the right and wrong way to do it:

  1. Invoke a copy of the IDE, and load the first sketch "HelloWorld," and invoke the monitor. Notice it opens a second window, leaving the original blank for some reason. In any case, it will default to the correct COM port:
    .
  2. Now we need to load the "DigitalReadWrite" sketch. However, the mistake I was making was to believe that the new window created when the second sketch is loaded would be independent of the other. It's not. A change in the COM port of one will change the COM port of the other, leading to much confusion and trampling of code.
    Here's the wrong way:
    .
  3. Instead, invoke a completely new IDE and load the second sketch. In fact, I find it helps to physically position one Arduino on the left of my keyboard, and move the corresponding IDE windows to the left of the screen, while the other Arduino is on the right side of my keyboard and so forth.
    It should look like this:
    .
    When the IDEs are set up in this fashion, the downloads and monitoring will be completely separate and independent. It's a really terrific way of troubleshooting handshaking between multiple Arduinos.

My apologies to the forum for not getting this sooner, and for the confusing deletes. I hope someone benefits in the long run.

Nice pictures.

My last related response was to your example #2. My point was if you used two instances of a terminal program (like brey terminal) set to different comm ports (which also adds many serial monitoring features) and not use the Arduino serial monitor, you could retain the ability to monitor two Arduino boards with just one instance of the Arduino IDE open, but still with two sketch windows open, and still have the ability to download in the separate sketch windows shown in your example #2. Have you tried that and still find some functionality lost?

My main point is any restriction seems to be with just the behaviour of the serial monitor, not the ability of the Arduino IDE to manage two open sketches under one instance of the IDE. In my test the two sketch windows retained their unique comm port assignments. Only the serial monitor, which cannot seem to have two instances open and attached to each sketch, seems to create a problem. Am I correct or missing something?

Either way, I have found that the Arduino serial monitor has such limited capablities, that I use brey terminal even when just working with one sketch for only but the most limited serial monitoring tasks.

Lefty

Thanks for the clarification, Lefty. And for the tips. I believe we can file this thread under "solved."