• Ingen resultater fundet

input (sdbmsg);

output ();

action

DisplayComm(sdbmsg);

ConnManagementLayer.openConnection(extdisplay, "localhost", 9000);

ConnManagementLayer.closeConnection(extdisplay);

(SDB,sdbmsg)

(destcomp,sdbmsg)

Fig.9.TheSerialDataBuspageoftheAMSCPNmodel.

usedto send thetwo integers, and thereceive primitive isused to receive theresponse from

thevisualisationpackage caused bythe userclickingon theContinue button.

val extdisplay = "extdisplay"; (* --- name of connection --- *)

(* --- map subcomponent to an identifier --- *)

fun ComponentOpcode (MCC _) = "1"

| ComponentOpcode (DISPLAYPROC (DISPLAY HUD)) = "2"

| ComponentOpcode (DISPLAYPROC (DISPLAY MPD)) = "3"

| ComponentOpcode (SENSOR ADC) = "4"

| ComponentOpcode (SENSOR RADAR) = "5"

| ComponentOpcode (SENSOR RALT) = "6"

| ComponentOpcode (SENSOR WRW) = "7"

| ComponentOpcode (SENSOR INS) = "8";

(* --- update the external display and wait for Continue --- *)

fun DisplayComm ({src,dest,...} : SDBMsg) =

let

val (src', dest') = (ComponentOpcode src, ComponentOpcode dest)

in

ConnManagementLayer.send(extdi spla y,src '^", "^de st',s trin gEnco de);

ConnManagementLayer.receive(ex tdis play, stringDecode);

()

end;

Fig.10.SMLfunctionsforvisualisingSDBcommunication.

5 Conclusions and Future Work

Comms/CPNoriginatedfromadesiretoprovidevisualisationofthesimulationofAMSCPN

models. Existing methods of visualisation were not satisfactory in this case, either through

beingtoodetailedorbyhavinglimitedcapabilityandbeingtiedtotheDesign/CPNGUI.By

developinganexternalvisualisationpackage, accessto greatergraphicalcapabilitiesbecomes

thenecessarycommunicationinfrastructureto allowthe externalvisualisationto take place.

Thefunctionalandnonfunctionalrequirementsofthislibrarywereconsideredanditwas

determined that ve main functions must be provided, i.e. opening and accepting

connec-tions, sending data to and receiving data from external processes, and closing connections.

It was alsodetermined thatthelibrary mustsupportmultiplesimultaneousconnections and

allow dynamic creation of connections. From these requirements, the library was designed.

Threeareasofdesignwereconsidered.Theywerethefundamentalmethodofcommunication,

connection management, and data transfer. The architecture of Comms/CPN was dened

to consist of three layers,sitting between Design/CPN and TCP/IP. The Communication

Layer provides the interface to TCP/IP, the Messaging Layer introduces message passing

scheme,and theConnectionManagement Layerprovides theinterfaceto Design/CPN.

The current implementation of the library poses some diÆculties when it comes to

ac-cepting incoming connection requests and receiving data. When listening for an incoming

connection request, Design/CPNblocks causingthesimulationof theCPN modelto block

also. The same situation occurs when a receive operation is called but there is no data to

receive. This blocking property is unfortunate if Design/CPN is performing a simulation,

because itcausestheentiresimulationtoblock(asDesign/CPN ispurelysinglethreaded.)

Onepossibleareaforinvestigationinthefutureistoprovidenon-blockingoptionsforboth

thereceiveandacceptoperations.Thisisoneareawhereusingamessengersubprocesswould

have providedarelativelysimplesolution,asdiscussedSect. 2. Thereisa possibilitythatin

the future,Comms/CPNcould beusedinconjunction withan externalsubprocess,to form

a hybridPure TCPand Messenger solution. A systemcallsimilarto the selectcall intheC

programminglanguagewouldalsoprovideasolution.UsingConcurrentML(CML)[5]instead

ofSML astheprogramminglanguagefortheDesign/CPNsimulatorandforComms/CPN

wouldeliminatetheblockingissuesand sowould also provideasolution.

Currently,thelibraryonlyfacilitateseach connectiontobeconnectedtoasingleexternal

process. To connect to more than one external process, multiple connections are used. It

maybe possibletoextendthelibraryfunctionsto allowmulticasting wherebymore thanone

external process can receive the same data from a single connection. In this way multiple

externalprocesseswillreceiveexactlythesame data.Suchmulticastingwouldbeusefulwhen

using this library for the purposes of visualisation of Design/CPN simulations because it

wouldallowexactly thesame visualisationto be seenon dierent remotemachines.

Whenaconnectioniscreated,thecurrentimplementationrequirestheusertoprovidethe

unique identier. Future implementations of thislibrarymaygive Design/CPN theability

to providethis unique identier itself, and to return this automatically generated identier

to the userforsubsequent use.

Anotherareaoffuturedevelopmentwouldinvolvethecreationofcommunicationmodules

like Java/CPN forother programminglanguages,suchasC/CPN, Perl/CPNand soon.

Another issue to consideras part of future work is to make Comms/CPN and Java/CPN

librariesmore fault tolerant.

Acknowledgments. TheworkpresentedinthispaperwassupportedbytheAustralianDefence

ScienceandTechnologyOrganisation(DSTO)undercontractno.687237, andbyaDivisional

Small Grant from theUniversityof South Australia.The authorsalso acknowledge valuable

commentsand feedbackfrom Prof.Jonathan Billington.

1. AnimationbyMimic/CPN. http://www.daimi.au.dk/desig nCPN /lib s/mim ic/.

2. C. Capellmann, S. Christensen, and U. Herzog. Visualising the Behaviour of Intelligent Networks. In

Services and Visualisation, Towards User-Friendly Design, volume1385 of Lecture Notes in Computer

Science,pages174{189.Springer-Verlag,1998.

3. ComputerSystemsEngineeringCentre. http://www.unisa.edu.au/eie/c sec.

4. D.E.Comer. Computer NetworksandInternets. Prentice-HallInternational,Inc., 1997.

5. Concurrentml. http://cm.bell-labs.com/cm/cs/ who/ jhr/s ml/c ml/i ndex. html .

6. G.GallaschandL.M. Kristensen.Comms/CPNlibrary.

http://www.daimi.au.dk/designCP N/li bs/co mmsc pn/.

7. TheGAPGroup,Aachen,StAndrews.GAP{Groups,Algorithms,andProgramming,Version4.2,1999.

(http://www-gap.dcs.st-and.ac.u k/~g ap).

8. R. Harper. Programming in Standard ML. School of Computer Science, Carnegie Mellon University,

http://www.cs.cmu.edu/ rwh/introsml/,2000.

9. Javaswinglibrary. http://java.sun.com/products/jf c/ts c/ind ex.h tml.

10. java.sun.com-TheSourcefor Java(TM)Technology. http://www.java.sun.com/.

11. K.Jensen. Coloured Petri Nets. BasicConcepts, Analysis Methodsand Practical Use. Volume1, Basic

Concepts. MonographsinTheoreticalComputerScience.Springer-Verlag,1992.

12. J.B.JrgensenandL.M.Kristensen. Design/CPNCondensed StateSpaceToolManual. Departmentof

ComputerScience,UniversityofAarhus,Denmark,1996.

Online:http://www.daimi.au.dk/desi gnCPN /.

13. L. M. Kristensen, S. Christensen, and K. Jensen. The Practitioner's Guide to Coloured Petri Nets.

InternationalJournalonSoftwareToolsfor TechnologyTransfer,2(2):98{132, 1998.

14. O.Kummer,D.Moldt,andF.Wienberg. AFrameworkforInteractingDesign/CPN-andJava-Processes.

InJ.KleijnandS.Donateli,editors,ApplicationsandTheoryofPetriNets,volume1639ofLectureNotes

inComputer Science.Springer-Verlag,1999.

15. B. Lindstrm. Web Based Interfaces for Simulation of Coloured Petri Net Models. In K. Jensen,

editor, Proceedings of Workshop on Practical Use of High-level Petri Nets, pages 15{32.

Depart-ment of Computer Science, University of Aarhus, Denmark, 2000. DAIMI PB-547. Available via

http://www.daimi.au.dk/pn2000/proceedings/.

16. C.DouglassLocke,L.Lucas,andJ.B.Goodenough. GenericAvionicsSoftwareSpecication. Technical

ReportCMU/SEI-90-TR-8,Software EngineeringInstitute,CarnegieMellonUniversity,December1990.

17. L. Lorentsenand L. M. Kristensen. Exploiting Stabilizers and Parallelism in StateSpace Generation

withthe SymmetryMethod. InProceedings of InternationalConference on Application ofConcurrency

inSystem Design(ICACSD'2001),pages211{220.IEEEComputerSociety,2001.

18. Design/CPNMessage SequenceChartslibrary.

http://www.daimi.au.dk/designCP N/li bs/ms char ts/.

19. S.NimsgernandF.Vernet. CommunicationbetweenColouredPetriNetSimulationsand External

Pro-cesses. Master'sthesis,DepartmentofComputerScience,UniversityofAarhus,2000.

20. StandardMLofNewJersey. http://cm.bell-labs.com/cm/ cs/wh at/s mlnj/ .

21. Design/CPNOnline. http://www.daimi.au.dk/designCP N/.

22. Z. Qureshi,L. M. Kristensen, and J. Billington. Towards Modelling and Analysis of Avionics Mission

Systemsusing ColouredPetriNetsand Design/CPN. Technicalreport, DefenseScienceandTechnology

Organisation,2001. DivisionalDissussionPaper.

23. J. L. Rasmussen and M. Singh. Designing a Security System by Means of Coloured Petri Nets. In

ProceedingsofICATPN'96,volume1091ofLecture NotesinComputer Science,pages400{419.

Springer-Verlag,1996.

24. AustralienDefenceScienceandTechnologyOrganisation.

http://www.dsto.defence.gov.au.

25. SML/NJlibrary.

http://cm.bell-labs.com/cm/cs/w hat/ smlnj /doc /smln j-li b/in dex.h tml.

26. W.Stallings. DataandComputer Communications. Prentice-Hall,2000.

27. J.D.Ullman. ElementsofMLProgramming. Prentice-Hall,1998.