Relative Content

Tag Archive for c#serial-port

C# How can detect print button press of a digital scale

I’m using C# dotnet 4.8 to create an application that read weight value from digital scale and print it to an excel file. Currently, I have read the weight data from scale through serial port. I see in some example aplications, they can detect the press event of the button on the digital scale. I made a lot of search on google but can not find the solution. Please show me if you know.

c# inserting a value at the end of the array befroe sending it through the serial port

I have have a small problem and need your help please, I have an array and a textbox , the user will enter a decimal value of maximum 32 bits in the text box , this value needs to be added at the end of the array and sent via serial port as binary value, hence the **var **addressAndOpcode
I am struggling because the textbox input is string , how can I do this please ?thanks

inserting a value at the end of the array befroe sending it through the serial port

I have have a small problem and need your help please, I have an array and a textbox , the user will enter a decimal value of maximum 32 bits in the text box , this value needs to be added at the end of the array and sent via serial port as binary value, hence the **var **addressAndOpcode
I am struggling because the textbox input is string , how can I do this please ?thanks

C# Serial Port hangs 30 sec or 1 min when I call Open or Close Function

I have developed a testing program in C# that communicates with a certain device via serial port to exchange data. I open and close the serial port to transmit and receive data using Open() and Close(). Sometimes, when I call Open() or Close(), it executes immediately, but other times it hangs for about 30 seconds or 1 minute.