Page 1 of 1
Display a text
Posted: Fri 27. Sep 2013, 18:01
by lucasclk
Hi I am using the PCAN Explorer 5 and the add-in Instruments Panel.
I have been trying to write a programm to display some information on the .ipf window.
For those information that only includes digits and I manage to do it by using the ValueIndicator.
However I cant find the way to display a short text(string). Hopefully I could get some suggestions here. Thanks.
Re: Display a text
Posted: Sat 28. Sep 2013, 21:04
by PEAK-Support
The information you talk about, is it a signal, a fixed text, raw CAN Data...?
Please send us a sample and we could solve your problem. If you still use the scripint interface (VBS) it is possible to use nearly all information and convert it to a Text Label.
Re: Display a text
Posted: Mon 30. Sep 2013, 11:59
by lucasclk
For Example I create a ValueEdit box and whenever I key in a code(eg. Date of Birth: 20130930) and click the "Set" button the information of day of birth(numbers), month of birth(in text: "September") and the year of birth(numbers) should be displayed in three different boxes. For the year of birth I should save the numbers in a signal and display it with a ValueIndicator and I wonder if I could do the same for the month of birth which should display a text.
Re: Display a text
Posted: Mon 30. Sep 2013, 12:24
by PEAK-Support
Have you create a VBScript and used the script to do that?
Re: Display a text
Posted: Mon 30. Sep 2013, 13:14
by lucasclk
Yes... The code in the script looks so far like this...
Sub ConvertDOB()
Dim input, date, month, year
Set input = Signals("Input")
Set year = Signals("Year")
year.Value = left(input.StringValue, 4)
End Sub
Re: Display a text
Posted: Mon 30. Sep 2013, 14:06
by PEAK-Support
If you run a VBS, only one function/sub work at the same time. So you could permanently check if the input signal is changed in a loop inside your script (bad choice..) or set a function behind every "SET" which execute a VBS function. Inside this function, you could manipulate the signal infomation etc.

- SET-Function.JPG (81.28 KiB) Viewed 10560 times
Re: Display a text
Posted: Mon 30. Sep 2013, 15:05
by lucasclk
Actually this is what I meant
Re: Display a text
Posted: Mon 30. Sep 2013, 15:38
by PEAK-Support
Try to use a label instead of a Value Indicator (they could only work with signals, and string are not allowed for signals)
With the label you also could use the ENUM function of the Value, and set 1= January, 2=February etc.
Re: Display a text
Posted: Mon 30. Sep 2013, 17:02
by lucasclk
Thank you very much this is the perfect solution that I was looking for. Appreciate your help a lot.
I do have another question. Is it possible to clear the text in the field everytime the "SET" button is clicked?
Re: Display a text
Posted: Thu 31. Oct 2013, 09:12
by PEAK-Support
sorry for the delay...
Is this what you want:
You enter the text, the customer press "SET", your read the text and use it in your script and after that you want to clear the field for new entry?
This is hard to do, because the value you entered is directly linked to the signal.
To make this more clear, you could set the property "Signal Feedback" so that you also will see in the Value Edit field if the signal was changed.
As a workaround, you could use virtual signals for the Value Edit box, then copy the changed signal into your real signal, and set the virtual signal to 0 to clear the input box of the Value Edit field.