The questions were not about time_spec_t and get_real_secs()..I wondered that
"How can I execute the command usrp->get_time_now(); and usrp2->get_time_now();
simultaneously.As I mentioned the previous question, I tried to use
set_command_time(), but it does not work.the code that I tried
is---------------------------------------------------------------usrp->set_time_next_pps(uhd::time_spec_t(0.0));
usrp2->set_time_next_pps(uhd::time_spec_t(0.0));
boost::this_thread::sleep(boost::posix_time::seconds(2)); uhd::time_spec_t
start_time = usrp->get_time_now() + uhd::time_spec_t(0.3);
usrp->set_command_time(start_time); uhd::time_spec_t usrp_t =
usrp->get_time_now(); uhd::time_spec_t usrp2_t = usrp2->get_time_now();
usrp->clear_command_time(); std::cout << boost::format( " Start
: %f us\n" " Response 1: %f us\n" " Response 2: %f
us" ) % (start_time.get_real_secs()*1e6) % (usrp_t.get_real_secs()*1e6)
% (usrp2_t.get_real_secs()*1e6) << std::endl; std::cout << boost::format(
" Difference of response time 1: %f us" ) % ((usrp_t -
start_time).get_real_secs()*1e6) << std::endl; std::cout << boost::format(
" Difference of response time 2: %f us" ) % ((usrp2_t -
start_time).get_real_secs()*1e6) <<
std::endl;-------------------------------------------------------------------------------------------OUTPUT-------------------------------------Checking
USRP devices for lock.Waiting for reference lock.... * 30FDE72: LOCKEDWaiting
for reference lock... * 3125CB5: LOCKEDQuerying Clock for time and setting USRP
times... Start : 1329026.312500 us Response 1: 1329026.625000 us Response
2: 1329261.625000 us Difference of response time 1: 0.312500 us Difference of
response time 2: 235.312500
us-----------------------------------------------------------------What I
expect was, in OUTPUT, Difference of response time 2 should be 0.312500 us, not
235.312500 us.This result means that the command usrp->get_time_now(); and
usrp2->get_time_now(); were not executed simultaneously.I also changed the
code-----------------------------------------------------------------uhd::time_spec_t
start_time = usrp->get_time_now() +
uhd::time_spec_t(0.3);usrp->set_command_time(start_time);uhd::time_spec_t
usrp_t = usrp->get_time_now();uhd::time_spec_t usrp2_t =
usrp2->get_time_now();usrp->clear_command_time();-----------------------------------------------------------------to-----------------------------------------------------------------uhd::time_spec_t
start_time = usrp->get_time_now() +
uhd::time_spec_t(0.3);usrp->set_command_time(start_time);usrp2->set_command_time(start_time);uhd::time_spec_t
usrp_t = usrp->get_time_now();uhd::time_spec_t usrp2_t =
usrp2->get_time_now();usrp->clear_command_time();usrp2->clear_command_time();-----------------------------------------------------------------But
it does not work.Again, How can I execute the command usrp->get_time_now();
and usrp2->get_time_now(); simultaneously?usrp: USRP B210usrp2: USRP B200Hojoon
-----------------------원본메일-----------------------보낸사람 : "Marcus D. Leech via
USRP-users" <[email protected]>받는사람: [email protected]보낸날짜:
2018-04-26 01:41:04 GMT +0900 (Asia/Seoul)제목: Re: [USRP-users] synchronization
between two usrps.
On 04/25/2018 10:53 AM, Hojoon Yang via USRP-users wrote:
Hi,
I connected one usrp b210 and one usrp b200 to octoclock for
synchronization.
I'm trying to verify that the usrps connected to octoclock is "really"
synchronized.
To check it, I did as follows.
usrp->set_time_next_pps(uhd::time_spec_t(0.0));
usrp2->set_time_next_pps(uhd::time_spec_t(0.0));
boost::this_thread::sleep(boost::posix_time::seconds(2));
uhd::time_spec_t start_time = usrp->get_time_now() + uhd::time_spec_t(0.1);
usrp->set_command_time(start_time);
uhd::time_spec_t usrp_t = usrp->get_time_now();
uhd::time_spec_t usrp2_t = usrp2->get_time_now();
usrp->clear_command_time();
I think I did wrong, because the results are different from my expectations.
Q1. Can I execute usrp->get_time_now(); and usrp2->get_time_now();
simultaneously? I'm trying to use set_command_time, but it didn't work well as
above.
Q2. How can I verify that the two usrps connected to the octoclock, is
really synchronized? in terms of time..
I already used get_time_last_pps() command, this command works perfect, the
two usrps showed same value.
but this command only showed "the full_secs" which does not include
frac_secs.. I want to check "the frac_secs" between two usrps.
I read this thread,
http://lists.ettus.com/pipermail/usrp-users_lists.ettus.com/2015-January/012227.html
But, I can't find the way to check frac_secs..
Hojoon
https://files.ettus.com/manual/classuhd_1_1usrp_1_1multi__usrp.html#afb4bffe3f969c11ee7c0a2cba5178780
Returns a time_spec_t, and there are multiple methods associated with
time_spec_t
https://files.ettus.com/manual/classuhd_1_1time__spec__t.html
Including get_real_secs()
Many of the example programs included with UHD source use this method--you
could look there usage examples.
_______________________________________________
USRP-users mailing list
[email protected]
http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com