Display a text
Display a text
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.
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.
- PEAK-Support
- Sales & Support
- Posts: 1646
- Joined: Fri 10. Sep 2010, 19:34
Re: Display a text
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.
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.
--------------------------------
PEAK-System Technik
Technical Support Team
support[at]peak-system.com
-------------------------------
PEAK-System Technik
Technical Support Team
support[at]peak-system.com
-------------------------------
Re: Display a text
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.
- PEAK-Support
- Sales & Support
- Posts: 1646
- Joined: Fri 10. Sep 2010, 19:34
Re: Display a text
Have you create a VBScript and used the script to do that?
--------------------------------
PEAK-System Technik
Technical Support Team
support[at]peak-system.com
-------------------------------
PEAK-System Technik
Technical Support Team
support[at]peak-system.com
-------------------------------
Re: Display a text
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
Sub ConvertDOB()
Dim input, date, month, year
Set input = Signals("Input")
Set year = Signals("Year")
year.Value = left(input.StringValue, 4)
End Sub
- PEAK-Support
- Sales & Support
- Posts: 1646
- Joined: Fri 10. Sep 2010, 19:34
Re: Display a text
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.
--------------------------------
PEAK-System Technik
Technical Support Team
support[at]peak-system.com
-------------------------------
PEAK-System Technik
Technical Support Team
support[at]peak-system.com
-------------------------------
Re: Display a text
Actually this is what I meant
- Attachments
-
- Example.png (30.7 KiB) Viewed 10562 times
- PEAK-Support
- Sales & Support
- Posts: 1646
- Joined: Fri 10. Sep 2010, 19:34
Re: Display a text
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.
With the label you also could use the ENUM function of the Value, and set 1= January, 2=February etc.
--------------------------------
PEAK-System Technik
Technical Support Team
support[at]peak-system.com
-------------------------------
PEAK-System Technik
Technical Support Team
support[at]peak-system.com
-------------------------------
Re: Display a text
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?
I do have another question. Is it possible to clear the text in the field everytime the "SET" button is clicked?
- PEAK-Support
- Sales & Support
- Posts: 1646
- Joined: Fri 10. Sep 2010, 19:34
Re: Display a text
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.
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.
--------------------------------
PEAK-System Technik
Technical Support Team
support[at]peak-system.com
-------------------------------
PEAK-System Technik
Technical Support Team
support[at]peak-system.com
-------------------------------