Skip to content

Instantly share code, notes, and snippets.

@mrupperman
Last active January 23, 2026 15:18
Show Gist options
  • Select an option

  • Save mrupperman/8a0761bbb416b8ef1ca4f51c228f63bf to your computer and use it in GitHub Desktop.

Select an option

Save mrupperman/8a0761bbb416b8ef1ca4f51c228f63bf to your computer and use it in GitHub Desktop.
Niagara Sample BQL Queries
Alarm Queries
local:|fox:|station:|slot:/|bql:select name as 'Point Name',out as 'Point Status' from control:ControlPoint where status.alarm = 'true'
local:|fox:|station:|slot:/|bql:select * from alarm:AlarmSourceExt where alarmClass = 'defaultAlarmClass' and status.alarm = true
alarm:|bql:select timestamp,alarmData.sourceName,sourceState,ackState,ackRequired,alarmData.msgText,alarmClass where alarmData.sourceName like 'B1J*' and alarmClass like '*1*' order by timestamp desc
alarm:|bql:select timestamp,alarmData.sourceName,sourceState,ackState,ackRequired,alarmData.msgText,alarmClass where alarmData.sourceName like 'B1J*' and alarmClass like '*2*' order by timestamp desc
alarm:|bql:select *
History Queries
local:|fox:|history:/MyStation/ZoneTemp|bql:select timestamp, value where timestamp in bqltime.today
history:|bql:select *
Component Queries
local:|fox:|station:|slot:/VAV_Bldg_1|bql:select slotPath as 'Path', displayName as 'Display', out.value as 'Output Value' from control:NumericPoint where displayName like '*ZN_T*'
local:|fox:|station:|slot:/VAV_Bldg_1|bql:select slotPath as 'Path', displayName as 'Display', out.value as 'Output Value' from control:NumericPoint where displayName like '*ZN_T*' or displayName like '*STPT*'
local:|fox:|station:|slot:/Exercises|bql:select * where slotPath like '*TrafficLight1'
Http Queries - Must be using Basic Hx Profile
http://192.168.7.194/ord?station:|alarm:/|bql:select%20*
http://192.168.7.194/ord?station:|alarm:/|bql:select%20timestamp,%20source%20where%20source%20like%20%27*Temperature*%27
http://192.168.7.194/ord?station:|history:/SqlDemo|bql:select%20*
http://192.168.7.194/ord?station:|history:/SqlDemo/ZoneTemperature|bql:select%20*
http://192.168.7.194/ord?station:|history:/SqlDemo/ZoneTemperature|bql:select%20status,%20value%20where%20timestamp%20in%20bqltime.lastweek (for this you can also use bqltime.lastmonth, bqltime.last7days, etc)
http://192.168.7.194/ord?station:|history:/SqlDemo/ZoneTemperature?period=timeRange;start=2016-04-05T00:00:00.000-00:00;end=2016-04-17T00:00:00.000-00:00|bql:select%20status,%20value,%20timestamp
http://192.168.7.194/ord?station:|history:/SqlDemo/AuditHistory|bql:select%20*
http://192.168.7.194/ord?station:|slot:/|bql:select%20name,out.value%20as%20%27Absolute%20Ord%27%20from%20control:NumericPoint
@rfincher86
Copy link

Does anyone know, how you can use BQL query to search for only points with specific tags?

If you have the Vykon modules they have a scalar function that works in BQL. Example: station:|slot:/Drivers/BacnetNetwork|bql:select * from baja:Component where vykonPro:Lib.hasTag('n:history') = 'true'

Replace "n:history" with whatever tag you are trying to search for.

@rfincher86
Copy link

Hi All,

Does if you can query to find a value in a tag for all points.

For example, creating a data table for all points in a certain device, but pulling the n:ordInSession Tag from each of them to display in the table.

Could have swore i've seen syntax like - bql select getTag(n:ordInSession) as 'Ord in Session' - but can't get it to work. Maybe I dreamt it. Or maybe this only works for direct tags?

Vykon pro has a scalar function for that as well. Example: station:|slot:/Drivers/BacnetNetwork|bql:select name as 'Name', vykonPro:Lib.tagValue('n:vendor') as 'Vendor' from baja:Component where vykonPro:Lib.hasTag('n:vendor') = 'true'

@sdhakal-cyber
Copy link

is there anyway we can write a program like a mpx script on a controller thats on shop and later dump that program on site controller? how can we do that effectively ? do we need to relatavize graphics to do that properly or there is another way ?

@sdhakal-cyber
Copy link

HI guys i am havig problem in override button while transfering it to webpage:it should show ok and cancel but shows submit submit any idea :
123

@rfincher86
Copy link

HI guys i am havig problem in override button while transfering it to webpage:it should show ok and cancel but shows submit submit any idea : 123

It is a bug in that version of Niagara. Change to an earlier or later version.

@sdhakal-cyber
Copy link

can i use same mpx frimware i am using for 4.15.1 if i upgrade it to 4.15.2

@rfincher86
Copy link

can i use same mpx frimware i am using for 4.15.1 if i upgrade it to 4.15.2

Im not a Schneider guy so I'm not sure about that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment