Jump to content

CommMG timing while using 2 connections


Recommended Posts

I have been using the excellent CommMG for a long time. Always happy with performance.

Today I have been using two different connections: one for a digital I/O board, and another for sending data.

I time the communication using high precision "QueryPerformanceFrequency". I could not understand a difference between my settings and the measured timer.

Using debugging I found that this code would take approx 70..100 msec - or about 35 msec each.

; --- select the I/O connection to trigger
_CommSwitch(1)
_CommSendstring("1")
_CommSendstring("Q")
; --- select the data connection to send data
_CommSwitch(4)
_CommSendstring("XYZ")

while without the _CommSwitch() the code block would take < 2 msec.

I tried with the 64 bit version of CommMG as well. No difference.

This may all be due to Windows functions being slow, and probably can't be improved ?

Is there a way to avoid commswitch, such as using two instances of something - my experience is not enough to suggest what. In Delphi, I would have used two instances of a connection.

 

 

I am just a hobby programmer, and nothing great to publish right now.

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...