Redlion Crimson 3 Log File and String Conflict

Sombrero

Member
Join Date
Jul 2016
Location
Acuna
Posts
17
Hi guys!!

I'm using a G315 HMI from RedLion to change an internal String tag via Data Entry, and I would like to add this tag to a Log file (.CSV). The problem I see is that I have a script that will order the data by separating the fields by looking for commas ','. I believe this will cause conflict if the user entered any commas in the entry keypad.

The question is, Is there any way to reject a data entry via the Validate option on the Entry of the Data Box if the user entered any commas? Or can I limit the user's entry pad to only use letters, numbers and spaces (and no use of symbols)?

I'm currently trying this code, but it doesn't seem to work:

Code:
int i;

for(i = 0; i < Len(Data); i++) {
	if(Data[i] == 44) {
		return false;
		break;
	}
}
return true;

Thanks in advance for your time!! đź“š
 
Last edited:
I haven't had much luck using the Validate action. I could be doing something wrong, but it doesn't seem to work using the "Data" variable as the manual states.

There are a few workarounds. You can apply a template to the string tag to only allow certain characters to be entered (letters, numbers, and spaces, for example).

Another option is to use the "On Entry Complete" action to run a script that scans through the string (not "Data", just whatever tagname you used) and removes any undesired characters. This is fairly straightforward using the string manipulation commands.

template.JPG
 
Great!! Thank you @kolyur for that option! I will use it as a workaround for now. I wanted to avoid that second option, I will come up with a script if the validate option fails again and I will post the results.

🍻
 

Similar Topics

When you run CRIMSON database in Emulated mode, does the data logger log data in to a directory in the PC that is tunning it? Is it possible to...
Replies
4
Views
4,228
Hi, I have a complex database in Crimson 3.0 and in one of the display pages I am trying to get a tag to show the sum of several other tags. The...
Replies
3
Views
151
It states WinPcap must be installed for the Emulator to function. WinPcap.org states that the technology is mature with no updates planned. Am I...
Replies
3
Views
842
Following on from another thread, I just downloaded Crimson 3.2 and it now supports CR and Graphite HMIs. Time for a 'play' :-) It seems to have...
Replies
14
Views
2,003
Action On Release command Set(ConveyorPopup,ConveyorPop_1) rejected w/ string tags. SetStringTag(index, data) wants an index. How does one pass...
Replies
8
Views
938
Back
Top Bottom