Ignition 7.9.10 Trends

#1

I can’t figure out what I’m doing wrong!

I select my pens from a Tranaction Group (as you can see in my pen selection) the database is correct as far as the value in the fields “685870_Ft” value = 9.53 but for some reason the pens are displaying their names as the value see the arrows

0 Likes

#2

How, exactly, did you populate your list of pens? What you show for your pen configuration would indeed show those pen names.

0 Likes

#3

Thanks for the reply, could it be that my database column names begin with a numeric instead of a string? (My problem is the value is being shown as the column name 68590, and not 9.53 which is the actual value of the tag) all 4 pens act the same.

All of my other trends were created exactly like this one and they all function. The only difference I see the Name of the column starts with a numeric instead of a string and all of the other trends column names start with a string.

I think I may have read at sometime the column names have to begin with a string, is this correct?

I’m using MSSQL.

0 Likes

#4

They can start with a number - but just because you can doesn’t mean you should! So again, how did you populate your list?

If there is a SQL query involved in the method you can rename the columns:

Select 123column as Widgets, time_stamp as date_time from db.tablename
where abc
order by xyz
0 Likes

#5

This is how I populated the pens.

I double clicked on the Object(easy chart) and the window that allows me to add pens came into views. Then under the “DATABASE” pens section I clicked on the + to add a new pen. from that window I selected my DATABASE, then my TABLE and then the COLUMN. Then I name the pen to a name of my choice.

I then just set some parameter for the chart

0 Likes

#6

So have you tried naming them with an ‘alias’ that doesn’t start with a number? E.g. P1_68590

0 Likes

#7

The data comes from a Transaction group, so the TAG was just dragged up into that group. I can’t rename the TAG because it is an MQTT tag.

I can change the TAG name but I have to go back to MQTT Gateway to get that done and I won’t be able to do that until Monday.

I can’t use an “ALias” in the query because Ignition (I guess) just somehow binds the Pen to the Database column.

0 Likes

#8

What happens when you run a SQL query using the query browser?

Run it for your other setup that the column names don’t start with a number, and run it again for this one that isn’t working that the column names do start with a number.

0 Likes

#9

If I run a simple query select 68590_Ft from tanklevels it returns 68590 as the row value(each row has this as the value).

If I run a simple query select Tk29296_Ft from tanklevels it returns the correct value for each row.

So it has to be the column name starts with a numeric value and needs to be a string value.

0 Likes

#10

OK, so can you change the column name in MS SQL at this point of development?

If not, the links I posted earlier suggested a work around;

Try running this query:

select "68590_Ft" as FT_68590 from tanklevels
0 Likes

#11

Yes, that query does work. So how do I make this query work with the easy chart? Everytime I try to add a database pen by using a SQL Query I get an error in the DBPens that say NO DATA and the only way I can fix is to delete easy chart and start over.

0 Likes

#12

When you get that error, are you trying my last line of SQL code?

EasyCharts are great for grabbing tags (with historical logging option enabled) from the tag browse tree and dragging on. They’re not so easy for yours and similar situations. Not saying it can’t be done, but it’s Saturday night here and I’m burning the midnight oil with no access to MS SQL (just MySQL here at home). So let me get back to you on that, someone else may advise further before I can.

It looks like you are creating an easy chart per sql clolumn/tank ref… as per your example anyway. If this is the case then you might consider using a basic chart not an easy chart… they’re a lot more friendly for dragging on, clicking on data source, choosing sql query, then you have free reign to put the “number_column” as “other_name”.

0 Likes

#13
0 Likes

#14

Ok, Thanks for all your help, I’m just going to change the tag name in my MQTT gateway and the problem will be solved, (BUT, it’s good to know about the column naming and which chart to use, because of how
it’s going to be populated.)
Once again thanks for your help.

1 Like