How to get the detector information from the COM interface of VISSIM

514 views Asked by At

How can I get the state of the detector from the COM interface of VISSIM?

2

There are 2 answers

0
Raj On BEST ANSWER

Detectors, or as Vissim calls it, Data Collection Measurements can be fetched from COM using the command:

Detector = Vissim.Net.DataCollectionMeasurements.ItemByKey(detector ID) 

Then you can check for the required values, if equipped using this command:

Speed = Detector.AttValue('Speed(Current,Avg,All)')

This will retrieve the current average speed for all the lanes.

1
Ling On

I have no idea about C#, but I know how to get the state of detectors from COM-interface of VISSIM.

sim = CreateObject("VISSIM.Vissim.700")

Detector=sim.net.Detectors

Set deton = dets.itembykey(1)

if you want to know, whether the detector is impulse or not

a=deton.attvalue("Impulse")

if you want to know, the speed of vehicles which is detected by this detectors then

b=detup1.attvalue("VehSpeed")

Then output the resu

guiSheet.Range("a1").Value = a
guiSheet.Range("b1").Value = b

Please pay attention, you have to define guiSheet as follows

guiSheet = Worksheets("VISSIM")

Then you can get the status of detector in VISSIM. In addition to speed and Impulse state, you also can find a lot of other states, e.g., occupancy.

I am also a beginner of VISSIM COM-Interface, hope the answer is helpful for you:)