How to convert String to Shift.Jis or Other data type to shift.jis

Hi All
I want to Convert string data type to Shift.jis data type to send the some value to Keyence PLC. I am using Kepware as a third party party communication software between Ignition and Keyence PLC.
Kindly give your suggestion.

Possibly something like this:

from java.lang import String

test = u"ö test string"
javaString = String(test)

#print javaString.getBytes("UTF-8")
print javaString.getBytes("Shift-JIS")

Thanks for your reply actually I want to write some value from Ignition to Keyence PLC.
My Ignition Data type is String and Keyence PLC data type is "shift.Jis".

I am looking for some code that should Convert the data type and write the value to PLC address.

You said Kepware is acting as the OPC server - what is the datatype of the Kepware tag you're using?

Hi All
Sorry I wrongly understood the existing communication concept. we are replacing existing Keyence HMI with Ignition. Actually in Keyence PLC the data type is String and in Keyence HMI it is Shift.jis.
we faced some communication issues when communicate through the KEPware.
Now we are directly communicating Keyence PLC directly using Keyence Build-in OPC UA.
Now it's working fine. But I am not sure not sure why the KEPware not accepting the string datatype for particular address.
I will attach the screen shots of KEPware error message.

Thanks for your support.


MicrosoftTeams-image (10)