hi sparky
There is a way to do it without addressing the tags in the modicon program, the process is similar but I think you need to link a .stu file instead of .xvm.
1. In Unity select all the tags you want to use in the PLC and export them in a .xvm file. I have taken to checking the "HMI" property on any tags I want on the HMI so I filter the tags by HMI property in the data editor and then export the list.
An aside:
the "HMI" tag property can be used in conjunction with one of the project properties to only include tags which have HMI checked in the data dictionary, which is some database of tags stored in the PLC memory that HMI software can read from the PLC to get a list of tags it can read.
2. In vijeo designer under IO manager add new driver, add driver modbus TCP modbus
3. IO manager ->modbusTCPIP, add new equipment, enter the IP address of your modbus slave (m340 plc)
4. right click variables in the tree and "Link Variables".
5. select the XVM file you made and the equipment at the bottom of the link variables dialog should be the modbus slave you made in step 3.
6. right click variables and select new variables from equipment. all the tags in the XVM file should be there. select the tags you want the HMI to read. I use "Variables that keep the same name" but you might have multiple data sources and want to select one of the other options to avoid tag name collisions.