Using 2x SUB-20 Master Slave... Error: |Timeout 0|

All about Sub-20 Multi Interface USB Adapter USB to I2C, SPI, GPIO, RS232, RS485, Ir, LCD

Moderator: serg

Post Reply
zia.newversion
Posts: 2
Joined: Fri Jul 02, 2010 6:24 am

Using 2x SUB-20 Master Slave... Error: |Timeout 0|

Post by zia.newversion »

Hi there!!!
I am not sure if this is a support forum. I just logged in for the first time. I apologize if I am posting in the wrong place. Please guide me if so.

I have a scenario in which I am using two applications running on two different computers with one SUB-20 connected to each. I am using SUB-20 modules to transmit data from one computer to the other. I am writing the applications for master and slave devices myself, using Visual Basic .NET 2005/2010. The algorithm seems fine and I cannot find an error of logic. But still when communication is initiated, the slave application quits with the message "Timeout 0"...

I have looked at the manual but I cannot find this error. "Timeout" is generated by GetStrError() and "0" is generated by "I2C_GetStatus()"...

"0" I2C Status indicates that there is no error!
"Timeout" is not listed anywhere in the manual.

If anyone could please highlight the possible mistakes I might be committing here, please enlighten me. I shall be very grateful if this problem can be solved by someone's kind suggestion.

xol
Site Admin
Posts: 241
Joined: Sat Aug 29, 2009 8:04 am

Re: Using 2x SUB-20 Master Slave... Error: |Timeout 0|

Post by xol »

Hi
first of all it is the right place to get support. Welcome to forum.

I must admit that it is a prety strange way to exchange data between pcs. Anyway...
To be sure we need to see a piece of slave code that fails. But more likely it does not fail at all. The 0 return code you get simply indicates that there is no data to read as master still have not sent any. All you have to do is to try to read again.
But again without see your code we can not say for sure. So please post it here for review.

zia.newversion
Posts: 2
Joined: Fri Jul 02, 2010 6:24 am

Re: Using 2x SUB-20 Master Slave... Error: |Timeout 0|

Post by zia.newversion »

I am sorry I could not reply on my own thread for such a long time... I was out of the place.
However, I have been reconstructing the slave program and if it gives the same error again, I shall definitely let you have a peek at the code. ;)
I must admit that it is a prety strange way to exchange data between pcs.
LoL. Actually it is not like I am trying to transmit files between PCs using I2C... I use USB Mass Storage Device for that purpose... :P
The thing is, I am building a simulator, or say, test bench for a power-supply unit. The unit has its own micro-controller which can transmit the telemetry data on an I2C channel. With the actual hardware, the controlling unit of the whole system sends signals, or say arrays of bytes, to the power-supply unit, calling for the current housekeeping and system-health data. The slave, or the PSU, in return, replies with the demanded data.
I have to do that whole hardware thing on computers... One of the computers (which I so cleverly called master :P) is the CU of the system whereas the other one (wittingly called slave by me :P) is the PSU of the system (both are simulators of the actual hardware)... That's the whole story.
I even tried to contact the company which manufactured the PSU, to have a peek at the code program running on micro-controller (a PIC16, I guess). But it turns out that the program is protected by some mean laws and they cannot let me have the code.

So, anything else you wanna admit, xol??? LoL... Have a nice time. Get back to you soon. Thanks for the support.

Post Reply