bzemba
Posts: 4
Joined: Fri Feb 19, 2010 12:09 am
Location: USA

Vport questions

Fri Feb 19, 2010 12:15 am

In regards to your Serial Tools Pro.

My plan with your product is to use your product to intercept data going through a comm port. I have an application that connects to a piece of hardware via a com port. Using your product I am pointing this application to a virtual port, capturing the data sent and then forwarding it to the piece of hardware. In a sense just monitoring the data going through the port for right now. I am having some problems accomplishing this task.

I am working with packets of various sizes. How does your vport.Buffersize work when it is set to zero?

I also have timeout constraints that need to be met on both sides. How is your onDataFromPort event handler being called? At the end of a timeout? At the end of the buffersize?

If i wanted to recieve one byte at a time on the vport how would I accomplish this? Just set the buffersize to 1?

Also is there a way to set the Baudrate for the virtual port? A way to detect what it is at?

I am using C# VS 2008

User avatar
johan
GpsGate
Posts: 14330
Joined: Wed Aug 04, 2004 10:40 pm
Location: Sweden
Contact: Website

RE: Vport questions

Fri Feb 19, 2010 12:36 am

Setting VPort.BufferSize to zero will be the fastest way to get data. Then you get data as it is received by the serial driver.

VPort does not use baud rates. You application in between has to control flow, if that is needed.

Regards,
Johan

Franson Support

bzemba
Posts: 4
Joined: Fri Feb 19, 2010 12:09 am
Location: USA

RE: Vport questions

Fri Feb 19, 2010 7:17 pm

The problem I seem to be having is that every time data is sent to the virtual port the onDataFromPort event is getting triggered twice, any clue as to why this would be happening?

User avatar
johan
GpsGate
Posts: 14330
Joined: Wed Aug 04, 2004 10:40 pm
Location: Sweden
Contact: Website

RE: Vport questions

Fri Feb 19, 2010 7:34 pm

It can be fired any number of times, until all data is through. What is the real problem?

Regards,
Johan

Franson Support

bzemba
Posts: 4
Joined: Fri Feb 19, 2010 12:09 am
Location: USA

RE: Vport questions

Fri Feb 19, 2010 8:01 pm

The real problem is that I am getting the same data twice. I have a monitor on the port and I know that the application is not sending the data twice. To explain this further when my application sends a packet to the Vport, the event ondatafromport is triggered twice with the same data.

User avatar
johan
GpsGate
Posts: 14330
Joined: Wed Aug 04, 2004 10:40 pm
Location: Sweden
Contact: Website

RE: Vport questions

Fri Feb 19, 2010 8:04 pm

You have probably subscribed twice to the OnDataFromPort event in your .NET code.

Regards,
Johan

Franson Support

bzemba
Posts: 4
Joined: Fri Feb 19, 2010 12:09 am
Location: USA

RE: Vport questions

Fri Feb 19, 2010 8:40 pm

That was it

Thanks!

Return to “SerialTools”