Jump to content
OpenSplice DDS Forum


  • Content count

  • Joined

  • Last visited

Everything posted by Kevkw.Chen

  1. Kevkw.Chen

    Number / Last Participant

    Hi , Check out dds_publication_matched_status or dds_subscription_matched_status . While the connection was changed , the callback will trigger and you can get current_count variable to know how many data reader or data writer is connecting .
  2. Kevkw.Chen

    idlpp with crosscompile

    Hi , Try this export LIBRARY_PATH=${LIBRARY_PATH}:/raspbian_root/lib before you run make or edit opensplice/setup/arm.linux_cross-common.mak line 112 : LDFLAGS = -L$(SPLICE_LIBRARY_PATH) $(SYSROOTFLAGS) to LDFLAGS = -L$(SPLICE_LIBRARY_PATH) $(SYSROOTFLAGS) -L/raspbian_root/lib
  3. Kevkw.Chen

    Not being notified of own publications

    Hi If you are sure not to use local to local transport , you could change XML file to set "EnableMulticastLoopback"= false Or you can use filter to filter topic content , if there is a variable to recognize machine , like topic key . But this method still cost DDS transport & discovery resources . <OpenSplice> <Domain> <Name>ospl_sp_ddsi</Name> <Id>0</Id> <SingleProcess>true</SingleProcess> <Description>Stand-alone 'single-process' deployment and standard DDSI networking.</Description> <Service name="ddsi2"> <Command>ddsi2</Command> </Service> <Service name="durability"> <Command>durability</Command> </Service> <Service name="cmsoap"> <Command>cmsoap</Command> </Service> </Domain> <DDSI2Service name="ddsi2"> <General> <NetworkInterfaceAddress>AUTO</NetworkInterfaceAddress> <AllowMulticast>true</AllowMulticast> <EnableMulticastLoopback>false</EnableMulticastLoopback> <CoexistWithNativeNetworking>false</CoexistWithNativeNetworking> </General> <Compatibility> <!-- see the release notes and/or the OpenSplice configurator on DDSI interoperability --> <StandardsConformance>lax</StandardsConformance> <!-- the following one is necessary only for TwinOaks CoreDX DDS compatibility --> <!-- <ExplicitlyPublishQosSetToDefault>true</ExplicitlyPublishQosSetToDefault> --> </Compatibility> </DDSI2Service> <DurabilityService name="durability"> <Network> <Alignment> <TimeAlignment>false</TimeAlignment> <RequestCombinePeriod> <Initial>2.5</Initial> <Operational>0.1</Operational> </RequestCombinePeriod> </Alignment> <WaitForAttachment maxWaitCount="100"> <ServiceName>ddsi2</ServiceName> </WaitForAttachment> </Network> <NameSpaces> <NameSpace name="defaultNamespace"> <Partition>*</Partition> </NameSpace> <Policy alignee="Initial" aligner="true" durability="Durable" nameSpace="defaultNamespace"/> </NameSpaces> </DurabilityService> <TunerService name="cmsoap"> <Server> <PortNr>Auto</PortNr> </Server> </TunerService> </OpenSplice>
  4. Kevkw.Chen

    Some error of pointer when use 'return_loan'

    Hi , So , will console printf data ? Why top1Seq_var and SampleInfoSeq_var ? They should be top1Seq and SampleInfoSeq , according to sample code . And what OpenSplice version you use ?
  5. Kevkw.Chen

    Some error of pointer when use 'return_loan'

    Hi , Try to check msg1Seq is not null nor 0 length before calling return loan status = top1dr->take( msg1Seq, info1Seq, LENGTH_UNLIMITED, ANY_SAMPLE_STATE, ANY_VIEW_STATE, ALIVE_INSTANCE_STATE); checkStatus(status,"pubsub::top1DataReader::take"); for (DDS::ULong i = 0;i<msg1Seq->length();i++) { top1 *msg1 = &(msg1Seq[i]); cout<<"receive data:"<<msg1->content<<endl; fflush(stdout); } if (msg1Seq->length() > 0) { status = top1dr->return_loan(msg1Seq,info1Seq); checkStatus(status,"pubsub::top1DataReader::return_loan"); } take method is non-blocking . Therefore , even no data coming , take will return and msg1Seq should be nothing .
  6. Kevkw.Chen

    C# no content is passed with sequence<char>?

    Hi , Please check your HelloWorldSplDcps.cs . In CopyIn method , code like below public V_COPYIN_RESULT CopyIn(System.IntPtr typePtr, DataType from, ref __DataType to) { if (from == null) return V_COPYIN_RESULT.INVALID; to.id = from.id; if (from.msg == null) return V_COPYIN_RESULT.INVALID; // Unbounded string: bounds check not required... if (!Write(c.getBase(typePtr), ref to.msg, from.msg)) return V_COPYIN_RESULT.OUT_OF_MEMORY; if (from.payload == null) return V_COPYIN_RESULT.INVALID; int attr2Seq0Length = from.payload.Length; // Unbounded sequence: bounds check not required... if (attr2Seq0Type == IntPtr.Zero) { IntPtr memberOwnerType = DDS.OpenSplice.Database.c.resolve(c.getBase(typePtr), fullyScopedName); IntPtr specifier = DDS.OpenSplice.Database.c.metaResolveSpecifier(memberOwnerType, "payload"); IntPtr specifierType = DDS.OpenSplice.Database.c.specifierType(specifier); attr2Seq0Type = DDS.OpenSplice.Database.c.typeActualType(specifierType); } IntPtr attr2Seq0Buf = DDS.OpenSplice.Database.c.newSequence(attr2Seq0Type, attr2Seq0Length); if (attr2Seq0Buf == IntPtr.Zero) return V_COPYIN_RESULT.OUT_OF_MEMORY; Marshal.Copy(from.payload, 0, attr2Seq0Buf, attr2Seq0Length); return V_COPYIN_RESULT.OK; } You have to modify code yourself to replace " attr2Seq0Buf " to " to.something " , which is according to your sequence structure . This was a idlpp bug which I have reported and fixed in OpenSplice 6.8.2 version . If this help you , you need this workaround or update to new version .
  7. Kevkw.Chen

    Mapping a partition to a channel

    Hi , Try the attachment . Below xml code block is part of the xml file . You can change Address "broadcast" to address your want. And change DCPSPartitionTopic to your qos partition name and topic name , which is separated with 1 dot . For examples : If you use Opensplice HelloWorld example , you should change xml file to <PartitionMapping DCPSPartitionTopic="HelloWorld example.HelloWorldData_Msg" NetworkPartition="networkPartition"/> Type command "osplconf" to help you modify xml file . <Partitioning> <GlobalPartition Address="broadcast"/> <NetworkPartitions> <NetworkPartition Address="broadcast" Name="networkPartition"/> </NetworkPartitions> <PartitionMappings> <PartitionMapping DCPSPartitionTopic="PartitionName.TopicName" NetworkPartition="networkPartition"/> </PartitionMappings> </Partitioning> ospl_sp_nativeRT.xml
  8. Kevkw.Chen

    Binding jython and c++

    Hi , I don't know DDS jython, but maybe you can check your C++ code. There are 2 possible things . P1 : You use read method without filter. After you use read method to get sample , the sample is still saved in the cache and change state to DDS_READ_SAMPLE_STATE . Something bad code like below : while(true) { int ret = reader.read (sample , no filter); if (ret > 0 ) printf( "%s\n", sample.msg) sleep(1 sec) } You will print sample.msg every time. So change to use filter will not happen . Or change to use take method , this will remove sample from cache P2 : Did you check valid_data flag in sample info ? After the writer write out a sample , the DDS middleware on reader side will tag the sample with 1. DDS_NOT_READ_SAMPLE_STATE , because you have not read / taken it 2. DDS_NEW_VIEW_STATE, because this instance is first time sent to you . 3. DDS_ALIVE_INSTANCE_STATE, because the writer , which produced this instance, still alive or no one dispose instance . After you read it , the state is changed to DDS_READ_SAMPLE_STATE . (If you read again with state filter DDS_NOT_READ_SAMPLE_STATE , you will return nothing ) And now , if your writer is killed or dispose the instance . The sample state on reader side will change to 1. DDS_READ_SAMPLE_STATE , because you have read it once. 2. DDS_NOT_NEW_VIEW_STATE, because you have seen it . 3. DDS_NOT_ALIVE_DISPOSED_INSTANCE_STATE or DDS_NOT_ALIVE_NO_WRITERS_INSTANCE_STATE And this is important , the DDS_DATA_AVAILABLE_STATUS is triggered , because the DDS_ALIVE_INSTANCE_STATE is changed . Even there is nothing sent to reader side . But the sample info will tag it "valid_data=false" to imply "this is not real data ." So , if you read sample without any state filter , and you don't check valid_data flag You will seem to see "you received twice sample" , but actually the second is invalid sample , because this is triggered by state change .
  9. Kevkw.Chen

    delivery delay

    Yes , the blocking happened at the writer side . Below is my guess : The reliable QoS will guarantee each sample sended to every reader . Therefore, if you shut down one reader while the right now sample is be transporting to it , the DDS thread at writer will block . Because the writer thread is waiting ack. If your writer don't produce sample in high frequency , it's not important issue . Maybe you can try ThreadPool option in xml configuration file or change reliable block time . Besides , when you use History Keep All , don't forget Resource limit QoS to control cache size .
  10. Kevkw.Chen

    delivery delay

    In my experiments , I met the write method will block for a seconds due to reliable QoS when subscriber and reader shut down un-naturely . And I can see error code , time out . I don't know if my experiment is like yours ?
  11. Kevkw.Chen

    Raspberry pi3 and vortex DDS

    1.Install Vortex DDS in PC and RPi3 . 2.go to examples directory and build all . 3.make sure your PC and RPi3 in the same IP network . 4. run any examples should work fine e.g: examples/dcps/HelloWorld or examples/dcps/Throughput PS: run subscriber before running publisher
  12. Kevkw.Chen

    Optimal QoS settings for high packet loss network

    Hi For your system , you can run examples throughput and ping pong to know if your network environment and computer is fine . For your program , you can use ospl tuner check topic QoS or restart ospl , the tuner can be a reader and writer to test . And if is the 5 seconds to connect enough ? I don'k now , maybe check DDS_PUBLICATION_MATCHED_STATUS before sending .
  13. Kevkw.Chen

    Data Types for IDL files

    In IDL file , the type "long" is "int" in C code and the type "long long" is "long" in C code . See http://download.prismtech.com/docs/Vortex/html/ospl/IDLPreProcGuide/keys.html#supported-types-for-keys So the question "Doesn't DDS support usigned int ?" , I think yes . (unsigned long in IDL) I think you should install 32-bit version DDS in Windows 7 64-bit and use 32-bit compiler , if you want use DDS in 32-bit system . Or you will see something like if your program transfers int64 to int32 , it will lost something .
  14. Kevkw.Chen

    Declaration of new data types to use in a topic

    You should write your struct in .idl file and use idlpp to generate the .c/.cpp and header file in OpenSplice . You don't need to write .c/.cpp or header yourself .
  15. Kevkw.Chen

    dds_take latency growing ?

    Greetings , I am using VortexLite . My problem is the latency for taking sample from cache will grow up every time in multi instance. How can I make it stable ? (can be high latency but must stable) I just find if I close the program and run again , the latency will be reset . But if I don't , the latency is growing . The image is showing the latency of dds_take for 20 times without stopping . I want to transmit a lot of data through DDS . In my case , I would have a lot of data writer to write sample for a single data reader . So I used the feature of the cache (sorting and history ). The scenario is like : TopicA : data , TopicB : notification . ProgramA . B and C have data writer for TopicA and TopicB. ProgramX has data reader for TopicA and TopicB. ProgramA . B and C are keep writing TopicA to ProgramX . The cache in ProgramX will sorting all TopicA by keyA ,B ,C and keep all history. If ProgramA finishes writing , it will write TopicB to ProgramX , saying "The data is fine , you can take all" . ProgramX will call ReadData function to take all data from ProgramA , but ProgramB and C are still writing data. int ReadData(void) { counter = 0; %dds_take max 256 samples for each time MAX_SAMPLES = 256; %create a handle for a target instance handle = dds_instance_lookup(reader,&key); %initial samples memset(msg,0,sizeof(msg)); for(i=0;i<MAX_SAMPLES;i++) samples = &msg; start_time = clock(); do{ ret = dds_take_instance(reader,samples,MAX_SAMPLES,info,handle,mask); if (ret>0 && info[0].valid_data) { for(i=0;i<ret;i++) Buf[counter+i] = msg.data; counter += ret; } }while(counter<5000);% I have 5000 data to read for each instance end_time = clock(); %total clock time for moving data from cache to Buf total_time = (float)(end_time - start_time)/CLOCKS_PER_SEC; free(Buf); return 0; } I see an older post talking about instance key unregister problem ? But dds_instance_unregister didn't support data reader in VortexLite . Thanks BR Kev
  16. Kevkw.Chen

    problem with license for OpenSplice Evaluation

    Greetings , I still can't make any file in OpenSplice Evaluation Linux 3.0 Above x64 => License could not be acquired And I can't open all TOOLs in the ospllauncher => License checkout failed I have put license.lic in the <opensplice_dir>/etc and source ./release.com I can't use Vortex Lite only forever . And VortexLite rlm also falied " no isv server" . Is that a problem with the license file ?
  17. Greetings , I use Ubuntu 14.04 LTS in VirtualBox , in windows7 64 bit . And I have downloaded OpenSplice Evaluation for linux 3.0 and 64-bit from http://www.prismtech.com/download-documents/1654 and installed it well . When I try to make example like /example/dcps/HelloWorld/c/standalone , I got error for " License could not be acquired" 1. I try "source release.com" then make again , error " License could not be acquired" 2. I try "rlm -c <license location/license.lic>" , and it shows "NO ISV servers to start" I got license.lic from email . Do I forget any step? I am trying to GOOGLE it ~ Thanks BR Kev
  18. Well I think just copy the makefile in the examples , and change filename to your in makefile
  19. Greetings , I am learning DDS by Vortex Lite in Ubuntu 14.04 LTS And I try exampl in /examples/c/durability . When I run subscriber , it always TIME OUT in dds_reader_wait_for_historical_data . I didn't modified the code , so it would be a BUG or something I missing to config ? I have tried to change QoS of durability => nothing works I have tried to modified lite.xml by adding partition in durability which matches to the code partition name . => nothing works Thanks BR Kev
  20. Kevkw.Chen

    example/durability subscriber timeout

    Hi James , Oh .. so if I want Publisher ( Vortex Lite) write sample for a late join Subscriber ( Vortex Lite) I should run OpenSplice ( in other PC or terminate ) between them to store sample ? If yes , I am sorry I did't understand User Guild well Thanks BR Kev
  21. Kevkw.Chen

    problem with license for OpenSplice Evaluation

    Hi , Thanks your reply. I have put inside <opensplice_install_dir>/etc and <vortex_install_dir>/license , still failed . I installed Vortex Lite , and it worked well . Thanks BR Kev