Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic COM Port Issue / Syntax Highlighting issue. (Read 4701 times)
Memhave1
Newbies
*
Offline


Posts: 9
Joined: Mar 10th, 2017
COM Port Issue / Syntax Highlighting issue.
Mar 10th, 2017 at 12:43pm
Print Post  
Can't seem to read/write to serial using this extension (but it works with Arduino IDE).

1. C# Console application for serial communications to Arduino,
2. Arduino Program to also read/write,

With this setup, using Arduino IDE I could read and write (sometimes I had issues if A/IDE was open, although most times not). 

I installed the vMicro extension, built and uploaded it to the Arduino - now when I launch my C# program (from the same VS2015 instance), some silly serial port monitor comes up. 

I close this yet I still cant read nor write to my serial port.

Does vMicro fiddle with serial ports or keep it open? 
Its unfortunate if it does as this means I wouldnt be able to use this awesome extension.

Also I followed http://www.visualmicro.com/post/2011/10/09/How-to-fix-Arduino-code-color-coding-fails-in-Visual-Studio-when-a-file-first-opens.aspx

But it doesnt actually work, all my code is still white :/
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12198
Location: United Kingdom
Joined: Apr 10th, 2010
Re: COM Port Issue / Syntax Highlighting issue.
Reply #1 - Mar 10th, 2017 at 5:23pm
Print Post  
Hi,

Quote:
With this setup, using Arduino IDE I could read and write (sometimes I had issues if A/IDE was open, although most times not). 

I installed the vMicro extension, built and uploaded it to the Arduino - now when I launch my C# program (from the same VS2015 instance), some silly serial port monitor comes up. 


Only one windows program can use a serial port at one time. If any Serial Monitor is open in any application your C# will fail. The times it failed with the Arduino IDE open will be when you had the Serial Monitor open in the Arduino IDE

The Visual Micro debugger uses Serial which is why the monitor opens. If you switch the tool bar from Debug to Release and then upload the Monitor will not automatically open.

The only other time you will hit an issue is if the upload doesn't close the port correctly but that would be extremly rare and an issue with the usb driver affecting all apps using the port. 

You have not said which board you have so I am going to assume the standard Arduino Uno starter? That doesn't normally suffer any usb complexities so I expect all your issues were related to the opening of the Serial Monitor.

Quote:
All my code is still white


You have not said which Visual Studio IDE you are using. Could you also provide a screen shot of the file mapping window where you manually added the arduino .ino extension?

Thanks
« Last Edit: Mar 10th, 2017 at 5:23pm by Tim@Visual Micro »  
Back to top
IP Logged
 
Memhave1
Newbies
*
Offline


Posts: 9
Joined: Mar 10th, 2017
Re: COM Port Issue / Syntax Highlighting issue.
Reply #2 - Mar 14th, 2017 at 11:42am
Print Post  
Hi, 
Thanks for the reply.
The issue regarding the serial port was indeed fixed by setting it to release as opposed to debug. 

I've restarted my machine a few times between now this post and the colours seem to have changed.

I (was)am using an Arduino Mega (2560) and I am using VS2015.

Thanks for the help.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12198
Location: United Kingdom
Joined: Apr 10th, 2010
Re: COM Port Issue / Syntax Highlighting issue.
Reply #3 - Mar 14th, 2017 at 5:47pm
Print Post  
Hi,

Are you saying the colors are working correctly now?

The serial port issue with debug enabled must be because you have set a serial port on "vMicro>Debugger>Local port"? If so then click the "Use Defaults" menu item on the same menu. 

Thanks
  
Back to top
IP Logged
 
Memhave1
Newbies
*
Offline


Posts: 9
Joined: Mar 10th, 2017
Re: COM Port Issue / Syntax Highlighting issue.
Reply #4 - Mar 15th, 2017 at 11:46am
Print Post  
Yes, the colours work current now.

I believe I am using the defaults - although I cannot see the local port setting within the debug side menu.

(There seems to be a bug with the menu too: When you go to vMicro -> Debugger -> hover mouse past or around "Override local port" - it will enter the field and you cannot click off it).
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12198
Location: United Kingdom
Joined: Apr 10th, 2010
Re: COM Port Issue / Syntax Highlighting issue.
Reply #5 - Mar 15th, 2017 at 2:50pm
Print Post  
Hi

I meant the "Override local port" option should be empty and not "Local Port"

The mouse hovering issue you mention is how Visual Studio works. I agree it's not ideal but if you click back on a sub menu name the focus leaves the textbox and normal hover resumes. Extensions do not have capability to change how menus work, we just provide an xml file for visual studio to tell it what menus we want it to create.
  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint