HerculesSETUP utility is useful serial port terminal (RS-485 or RS-232 terminal), UDP/IP terminal and TCP/IP Client Server terminal. It was created for HW group internal use only, but today it's includes many functions in one utility and it's Freeware! With our original devices (Serial/Ethernet Converter, RS-232/Ethernet Buffer or I/O Controller) it can be used for the UDP Config.
TCP server lisening on specified port in the Server status and show received data in RAW format. You can try Listen on port 80 on your PC and entry your IP address into your browser..
Note: Don't use receiveing port lower than 1024 in MS Windows, it can make you troubles with TCP/IP comunication, because Windows using these port numbers for system functions.
The UDP tab is simple "terminal" based on the UDP datagrams.
The main purpose of this tab is to send UDP packets from your computer to the destination. If you want to use UDP comunication mode, it's quite complicated to find some utility for debuging under Windows.
When I request 8192 bytes from the connected device, all is well. However when I request 12288 or 16384 from the connected device, I only receive between 10300 and 10500 bytes and calling the ClearCommError, seems to reveal a error code 1, which links to an overflow in the input buffer/queue.
My timeout is around 5 seconds, so more than long enough for the 12k or 16k bytes to arrive at the port. I am using a baud rate of 333,330 - unusual, but we are also developing the connected hardware. The same code runs on the hardware regardless of how much data is requested. So I don't think the problem is there, but I can check later using a terminal application.
Is it to do with the serial port I am using - a MOXA uPort 1250. I have looked at this device's config and cannot see anything about a buffer sizes. Unfortunately, I do not have any other serial port that I can try at the moment.
Try using one of the CVI RS-232 example programs in place of your commercial serial port utility? Shouldn't take too much modification to get it to work with your device, as the RS-232 API is really straightforward and pretty well documented.
Well, your use of a commercial serial port utility proofs absolutely nothing. That utility may as well not use GetOverlappedResult() at all but rather a synchronous ReadFile() instead. And if it uses GetOverlappedResult() (and ReadFile() too) it may (in fact it can) NOT rely on it returning all the data and hoping on the intermediate buffer to be large enough and work correctly and not do some fancy stuff, but rather check the returned data to be as large as it requested and if not, request up to N times for extra data.
Robust IO handling requires any app to not rely on the IO routines to just return whatever buffer it requested but instead check that the function returned with the requested amount of data and either bail out with an error or attempt to request the missing data again (with some maximum retry to not stay in an endless loop if the cable broke or something similar for instance).
If you would use VISA instead you can make a few such assumptions as VISA is programmed to provide a pretty clean and reliable API, but you can not expect the Windows API to behave in a certain way unless the MSDN documentation explicitedly states that the API works in that way. And when you think that it states such things, read it again and again and you will usually find out that it doesn't guarantee what you think it should.
Based on a previous suggestion by Sporty, I gave one of the CVI RS-232 examples a go (I only had about 30 minutes to spare at the time). Unfortunately I could not get it to function with my target device. I will probably try again soon.
With regards to why I am using Windows API. I have developed this application from historic code given to me by my colleague. This reason for this is because the larger functions which have been written which use the Windows API functions are still valid for communication with the new hardware we are developing. The only difference is that the response lengths have become many magnitudes bigger - and hence why I am probably running into problems.
With regards to my Commercial Serial Port utility, it has no idea how many bytes to expect back from the connected device, so it cannot request multiple times until the expected data is received. However, I do agree that I have absolutely no idea how it's receive mechanism might be coded. I was using it a proof that the problem is not with my connected hardware or the USB-Serial port that I am using.
In both cases, the receiver code tends to be always listening in a secondary thread, and will print whatever it gets to terminal. So while that help you verify your hardware is good, it doesn't really help you in your own development.
Powerful SERIAL PORT utility in Unity3D for Android, Linux, Mac OS, and Windows.
This is an extended plugin for Unity that gives developers an easy to use powerful computer communication solution.
When you use this plugin, you can spend time on important other works.
In spite of being a very useful and popular tool, still there are many problems related to its working and configuration. Some problems happen due to improper installation, driver, or outdated hardware. The first step to solve any problem is to identify the trouble, after which it can either be resolved by software, by manual configuration, or by a combination of both. If problems occur in your windows serial port connection, it becomes really difficult to troubleshoot them. This serial port utility comes with a windows driver that enables easy installation and serial port functionality.
So if you are using serial bus technology for your data communications, this tool is must for you. It can help you to communicate over large distances without any delays. For more information about this serial port you can browse the internet. But if you have new hardware for your computer, then you should check with the serialport manufacturer to get your tool.
Is there such a thing?
I want to use an Arduino Command-Line Utility into a C# program. At least this is my goal. I really hope there is such a thing in existence. I searched a little on the web, but is better to come here and ask directly to the source !!!
Thank you.
yes...I find some github pages/projects.... but I said to myself to ask here first - you guys KNOW BETTER than me choosing randomly !
So, what do you suggest/recommend for me?
....aha, you re-edited your last post...ok, I will go on those that you show there.
I hope you didnt pick them randomly and you actually used them.
Also...what im most interested in, is the 'serial monitor' function. This is what Im after to read from the interface. I hope your suggestions contain this special function in them, and hopefully, even more... Please check for me until I will familiarize myself, if indeed the CLI is containing 'serial monitor' and how is called. Thank you !
Is this Arduino CLI the default/official Command-Line Utility FROM Arduino?
Or is something made by a 3d party?
.....
edited after awhile ... I think I start to get it now. I start to click more links into that page you send me and I reach the github page of this Arduino CLI that you suggested. I also find the installation procedure and some more info in the very bottom of this page.
-cli
Based on the information you shared so far, I think J-M-L's suggestion of reading directly from the serial port in your C# code instead of using Arduino CLI for that purpose is the best approach.
The reason this could be interesting in theory is that Arduino CLI has a "pluggable monitor" system. This system allows for any arbitrary communication channel to be used as the "port" for communication between the computer and the Arduino board. In addition to the serial-monitor tool that is distributed by Arduino for communication over ports of the serial protocol. Boards platforms can provide their own pluggable monitor tools for communication with ports of other protocols. For example, the Teensy boards platform installs a custom teensy-monitor pluggable monitor tool for communication with the teensy protocol of the USB HID "ports" of Teensy boards.
So a valid use case for using Arduino CLI's monitor capability in an application (as Arduino IDE 2.x does) instead of implementing the port monitoring code in your own application code is that Arduino CLI acts as a "universal" monitor, which can use ports of any arbitrary protocol rather than only serial. Whether that pluggable capability is at all beneficial depends on your application. If you are only ever going to be working with serial ports, then there is no benefit. At this time, I'm only aware of the two pluggable monitor tools I mentioned. I expect that over time the Arduino community will take advantage of this recently added "pluggable monitor" system to create some amazing new ways of communicating with Arduino boards, but that future expansion of the pluggable monitor tool ecosystem is only hypothetical at this time.
Hmmm, to be totally sincere, I overlook the code, being super concentrated on the arduino setup. So I totally misread that code snippet in C#, until your mentions.
But - I still - think arduino board is imperative. Because it has a USB to serial hardware function build in. Without it, I will have to add my own USB to serial converter and is a pain in the but, also I dont have it separately, or unaware on other hardware I have. I know for sure arduino has it. So that's an important point in using this board.
(BTW, I have Arduino UNO (probably R3)) hardware board.
So... Im not completely sure, if I can use that --direct-- C# method mentioned only from the arduino board -directly-, without any helpful software like that command-line utility. But if this is a real option, then it is indeed simplifying the entire thing, immensely !
3a8082e126