Hello,
I have been trying to achieve two things just recently, and I'm starting to wonder if they are actually possible. To make matters more interesting, I'm working in Jython not Java.
The first I think isn't. I wish to write values to a waveform of string type (so caput -a PV_NAME 2 string_1 string_2 from a command line). The PV is read with no problem into text updates, where it is formatted with commas, or into an array of text updates where each element of the array shows each separate item in the waveform. (So, element 0 shows string_1, element 1 shows string_2). The problem is, I actually want to write the waveform back to the IOC, and it seems that this can't be done with strings. If I have a single line of text, then it truncates at 40 characters (which is fine for a string, but not for all the elements I need), and everything is placed into element 1. If I go for the simple example of an array linked to PV_NAME with a Text Input Control type, then attempt to alter the value in the array, then I get the following type of message (I've removed the name of the PV, and the timestamp, as both are irrelevant):
timestamp ERROR: Failed to write PV:PV_NAME
java.lang.Exception: Cannot handle type [Ljava.lang.String;
I had previously tried various things with scripts (as this is what I need to achieve in the end, writing to the waveform of string type using a script) but none of them worked either, often with type errors. So, can anyone give me any pointers as to where I go from here to try and solve this problem?
My other query should be answerable easily, one way or another I hope. I'm dynamically loading opis in linked containers, but, if certain key PVs are disconnected I'd like to either remove that container, or not load it in the first place. But, I don't know the PV names before running the script to load them dynamically. The names are semi static, but there is a part of them that can be altered without reference to me potentially, and there are a potentially large number of them to display (16*16*24), and I should probably look at paging them in some format or another, but if I can't see whether or not they are connected in the first place, as there may only be a smaller number set up (2*16*24) or (3*16*24) I could still end up showing a lot of useless information. Now, in order for the borders to change colour there must be something somewhere that says the PV has timed out or failed to connect, is there any way that I can access this information, or gather it in a different way? So far I've had no luck, so as I was asking one question, I decided to ask two...
Thanks for reading, and hopefully someone will be able to help,