09-15-2021 05:50 AM
Hi,
I have a following problem. I would like to ask for some help.
I would like to use PCA9546 I2C switch, with VirtualBench, and Labview.
This is the reading, and writing procedure.
I develope code, in Labview 2019 and I use VirtualBench I2C VIs.
My question. The PCA waits data, in the way what Figure 7 shows.
But.
According to the datasheet, I have to send 2 data package.
If I use I2C Config Bus.vi, I send the slave adress too. Should I send the adress again, or I2C Config Bus is a kind of I2C Write VI? I am confused. Please give me further details about I2C Config Bus.vi.
Thank you,
Have a nice day,
Gabor
09-15-2021 07:52 AM
The address and the Write/Read bit are handled by the driver. You just have to supply the byte(s) in the message data to write to the VI.
Are you getting an error? Your code looks fine for a quick command. For a long run, you really should not be initializing and closing the bus with each message.
09-16-2021 03:34 AM
Hi crossrulz,
Thank you, for the details.
I wanted to try the I2C VIs. It works, without error.
I didn't plan to close and reopen the bus. ( But, thank you for that advice! )
If I want to use the bus for a long term, I will start with my short code.
But, I wont close the bus. After that, I will switch the data lines as the Figure 7 shows.
Am I correct?
Thank you very much,
Gabor
09-16-2021 07:04 AM
@GaborZatik wrote:
But, I wont close the bus. After that, I will switch the data lines as the Figure 7 shows.
Am I correct?
Once you open the session, you can do the Write, Read, and Write/Read as much as you want until you close the session.