I want to create simulate slave on I2C bus using USB-8452. My external master send read request and I want to answer from simulated slave. But, when I want to use VI NI-845x I2C Slave Write.vi, I got this error -301782. What does it means, what is wrong?
I have already solved this topic. I have wrongly implemented the communication procedure of slave writing. Now, I have fixed.
I wanted to simulate slave with this behaviour: My master asks slave for a data. Slave should receive this request and answer to master. For this behaviour, I had to follow the procedure from NI help. It means to configure I2C slave, start I2C slave, wait for a message from master, read this message (VI I2C Slave Read send automaticaly acknoledge) and again wait for message from master (comand from master that slave can send data) then send a data to master by I2C Slave Write.
Here is a extract from my VI, which works me. I am bigginner with Labview, so the code isn´t so optimal 🙂
Also, take care for pull up resistors. You can switch ON by setting of I2C or you can use external resistors.
I hope it helps a bit.