![]() ![]()
You can see it on every windows-machine with a simple LED-Tester. EXCEL VBA SERIAL PORT MSCOMM CONTROL SOFTWAREIt is a fact, that windows sometimes sends pulses on TX and DTR even if no software using the port is running! EXCEL VBA SERIAL PORT MSCOMM CONTROL DRIVERI think the behavior occurs because windows or a driver is checking if new hardware is available.Īnd the maestro accepts and receives these pulses even when the statuslines are in off state. Windows or the driver does not activate the serial-statuslines! Only sends pulses on TX. My serial tester (hardware) show the sporadic datas on the TX-Line too when I replace the maestro with the tester. And suddenly without using my programm it goes to red error. Some minutes after the last command the red led stays off. In my new Excelmacro für controlling the Maestro I clear the errorstatus before each normal command. And we had a lot problems with measurmentmachines and euipment because of these “phantomdata” I had a lot to do with serial communication and measurement equipment in my job. With WIN 95/98/XP, WIN 7 and WIN 10 on many differnet computers and laptops. This behavior is known since Windows exist. periodically sends commands on all available ports. It is connected and connected to powerer. This erros occur even when I do not use the Maestro. It works, but I only get part of the string. LngStatus = CommOpen(intPortID, "COM" & CStr(intPortID), "baud=2400 parity=E data=7 stop=1") The string appears on my form, but that is as far as I get. Get to the exit do line, therefore stays in an endless loop. When I run it, and send the string "ST,+00009.28 g" it never seems to I think I am getting close, but have one hurdle that I cannot seem to solve. LngStatus = CommSetLine(intPortID, LINE_DTR, False)Īgain, thanks for helping me out, we are close I think. LngStatus = CommSetLine(intPortID, LINE_RTS, False) LngStatus = CommRead(intPortID, strData, 64) ' Read maximum of 64 bytes from serial port. LngStatus = CommWrite(intPortID, strData) LngStatus = CommSetLine(intPortID, LINE_DTR, True) LngStatus = CommSetLine(intPortID, LINE_RTS, True) LngStatus = CommOpen(intPortID, "COM" & CStr(intPortID), _ What am I doing wrong? Can someone help me put this together to read data from a serial port? I don't need to write, only read.ĭim intPortID As Integer ' Ex. It, it says "Sub or function not defined" on the "lngStatus = CommOpen(intPortID, "COM" & CStr(intPortID), "baud=9600 parity=N data=8 stop=1")" line. I did that as the first line after the 'Initialze Communications line. 'intPortID = 1" somewhere to set that variable to com1. I assume that I would need to add some code, i.e. EXCEL VBA SERIAL PORT MSCOMM CONTROL CODENot being very familiar with this routine, I downloaded the following code andĪdded it to a button on a form. So, I found a suggestion from someone that I handle serial communications with API calls. ![]() I have sort of come to the conclusion, that I need to take another route. ![]() I have worked on a solution for days and had a lot of help from other forum participants. After replacing the mscomm control with the new control, following the suppliers instructions to the letter, it works, but when I close one of the forms containing the newly added control,Īccess crashes. I found a control that is supposed to replace the mscomm control. EXCEL VBA SERIAL PORT MSCOMM CONTROL WINDOWS 7After moving to access 2007 and windows 7 of course, the mscomm control no longer works. It uses a MSComm control to read data from a scale. I have a legacy access 2000 database that has been in successful use for over 10 years. This is actually a continuation of a post already started relative to serial communications. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |