From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

I2C Addressing with USB-8452

Solved!
Go to solution

Hello everyone,

 

I am running into some inconsistencies when addressing I2C for writing strings to LCD screens. The LCD is from NHD and its data sheet can be found here. Below I have listed a list of Hex commands from the datasheet and I have successfully communicated with one LCD. I am now attempting to use the Hex commands found in that Datasheet to change its address to something other than the 7-bit default which is 0x28. I also made sure the LSB was 0 just as the LCD datasheet states. I have been trying to use address 0x2A, which is 00101010 in binary. This VI is suppose to change the address to 0x2A then display the I2C address on the screen. It does this successfully. Then when I go to run the VI addressed to the new address I get error 301742. Which just states the slave did not acknowledge an address and direction bit from the master. So I just need some guidance on correctly changing an I2C address. I will have 12 screens to communicate with at once. Also, I unfortunately am unable to transfer my VI to my network connected desktop so I have done my best to recreate it and attach it below. 

rholz_0-1642512219471.png

 

rholz_1-1642514181597.png

 

 

0 Kudos
Message 1 of 11
(1,921 Views)

rholz_0-1642514783913.png

Forgot to add some labeling. The blue boxes under the property nodes are all wired into those corresponding properties on those property nodes.

 

Thanks

0 Kudos
Message 2 of 11
(1,920 Views)

If you are trying to read a register from the device, you should be using the I2C Write Read VI.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 3 of 11
(1,906 Views)

Why are you posting a drawing from the VI rather than the VI itself (backsaved to an earlier version) or at least a LabVIEW snippet?

Rolf Kalbermatter
My Blog
0 Kudos
Message 4 of 11
(1,904 Views)

My computer with LabVIEW is unable to transfer things to my network connected PC. How it is where I work unfortunately

0 Kudos
Message 5 of 11
(1,899 Views)

I will give this VI a try.

 

Thank you for the response!

0 Kudos
Message 6 of 11
(1,898 Views)

The Write Read VI returns a similar error. Error 301713 which says an input parameter, or combination of parameters, is invalid. All I am trying to do is have the LCD tell me what address it currently has and then change it and write to that new address.

0 Kudos
Message 7 of 11
(1,853 Views)

It's very possible that the execution of the Change Address command has immediate effect, so you would have to update the address the USB-8452 uses for this resource accordingly before you try to read from the device.

Rolf Kalbermatter
My Blog
0 Kudos
Message 8 of 11
(1,843 Views)

This has actually been very confusing for me. I had an entire VI written after I had wired up my first screen and it wrote and read everything correctly. Then I disconnected that one and wired another to change the address of the 2nd screen. So I initially ran the VI with the default address and changed the address, the LCD correctly displayed this new address with the Hex commands given in the LCD datasheet. Then I tried to talk to them both and I got the Error 301742. Then I tried to communicate to them separately like before and neither are working now and are returning Error 301742. I have reprogrammed, rewired, used multimeter to check all signals, and I do not understand why they are not communicating. 

0 Kudos
Message 9 of 11
(1,835 Views)
Solution
Accepted by topic author rholz

Do you know if the LCD screen can remember its address after a power cycle? I think it does not have an EEPROM to remember the programmed address when power cycled.

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
0 Kudos
Message 10 of 11
(1,832 Views)